-
Notifications
You must be signed in to change notification settings - Fork 8
43 lines (41 loc) · 1.53 KB
/
initiate_release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Create release PR
on:
workflow_dispatch:
inputs:
version:
description: "The new version number following semantic versioning convention. Example: 1.40.1"
required: true
jobs:
init_release:
name: 🚀 Create release PR
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # gives the changelog generator access to all previous commits
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install poetry
run: pipx install poetry
- name: Update version.py and push release branch
env:
VERSION: ${{ github.event.inputs.version }}
run: |
poetry version $VERSION
sed -i "s/^VERSION = \".*\"/VERSION = \"$VERSION\"/" getstream/version.py
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
git checkout -q -b "release-$VERSION"
git commit -am "chore(release): $VERSION"
git push -q -u origin "release-$VERSION"
- name: Open pull request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr create \
-t "Release ${{ github.event.inputs.version }}" \
-l "ignore-for-release" \
-b "# :rocket: ${{ github.event.inputs.version }}
Make sure to use squash & merge when merging!
Once this is merged, another job will kick off automatically and publish the package."