-
Notifications
You must be signed in to change notification settings - Fork 168
68 lines (58 loc) · 1.9 KB
/
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
name: Release
on:
push:
branches: [ release ]
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GH_API_SECRET }}
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
pip install wheel
- name: Get Current Version
run: |
project_version=$(python3 setup.py --version)
echo "project_version=$project_version" >> $GITHUB_OUTPUT
id: get_current_version
- name: Create Tag
uses: mathieudutour/[email protected]
with:
custom_tag: "${{steps.get_current_version.outputs.project_version}}"
github_token: ${{ secrets.GH_API_SECRET }}
- name: Build Changelog
id: build_changelog
uses: mikepenz/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GH_API_SECRET }}
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: 'v${{steps.get_current_version.outputs.project_version}}'
body: ${{steps.build_changelog.outputs.changelog}}
token: ${{ secrets.GH_API_SECRET }}
- name: Build Python Package
run: rm -Rf build *.egg-info/ && python3 setup.py sdist bdist_wheel
- name: Publish to PyPi
uses: pypa/[email protected]
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Sync Release with Master
run: |
git fetch origin
git checkout release
git pull origin release
git checkout master
git pull origin master
git merge release --ff-only
git push origin master