-
Notifications
You must be signed in to change notification settings - Fork 69
80 lines (71 loc) Β· 2.56 KB
/
push-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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Upload LangKit python Packages
on:
release:
types: [released]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Poetry
uses: abatilo/[email protected]
with:
poetry-version: 1.6.1
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
cache: poetry
- name: Install dependencies
run: poetry install
- name: Autobump version
run: |
# from refs/tags/v1.2.3 get 1.2.3
VERSION=$(echo $GITHUB_REF | sed 's#.*/v##')
echo $VERSION
git config --local user.email "[email protected]"
git config --local user.name "github-actions[bot]"
poetry run bump2version patch --verbose --allow-dirty --commit --no-tag --new-version $VERSION
#push version bump to tagged branch so new version is included in pypi
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
force: true
- name: Build and publish LangKit to PyPI
run: poetry publish --build --username __token__ --password ${{ secrets.PYPI_API_TOKEN }}
bump_mainline:
runs-on: ubuntu-latest
needs: deploy
steps:
- uses: actions/checkout@v3
- name: Install Poetry
uses: abatilo/[email protected]
with:
poetry-version: 1.6.1
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
cache: poetry
- name: Install dependencies
run: poetry install
- name: read current version
run: |
# from refs/tags/v1.2.3 get 1.2.3
echo "VERSION=$(echo $GITHUB_REF | sed 's#.*/v##')" >> $GITHUB_ENV
- name: bump2version main to new release version
run: poetry run bump2version patch --verbose --allow-dirty --no-tag --new-version ${{ env.VERSION }}
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.VERSION_UPDATE_W0_AUTOMATOR }}
commit-message: Update version to ${{ env.VERSION }}
branch: update_release_version_${{ env.VERSION }}
base: main
delete-branch: true
title: "Bump version to ${{ env.VERSION }}"
committer: w0-automator <[email protected]>
author: w0-automator <[email protected]>