1
+ # This workflow will generate a distribution and upload it to PyPI
2
+
3
+ name : Publish Major Release X.0.0
4
+ on :
5
+ workflow_dispatch :
6
+
7
+ jobs :
8
+ build_and_publish :
9
+ runs-on : ubuntu-latest
10
+ steps :
11
+ - uses : actions/checkout@v2
12
+ with :
13
+ ref : dev
14
+ fetch-depth : 0 # otherwise, there would be errors pushing refs to the destination repository.
15
+ - name : Setup Python
16
+ uses : actions/setup-python@v1
17
+ with :
18
+ python-version : 3.8
19
+ - name : Install Build Tools
20
+ run : |
21
+ python -m pip install build wheel
22
+ - name : Remove alpha (declare stable)
23
+ run : |
24
+ VER=$(python setup.py --version)
25
+ python scripts/remove_alpha.py
26
+ - name : " Generate release changelog"
27
+ uses :
heinrichreimer/[email protected]
28
+ with :
29
+ token : ${{ secrets.GITHUB_TOKEN }}
30
+ id : changelog
31
+ - name : Commit to dev
32
+ uses : stefanzweifel/git-auto-commit-action@v4
33
+ with :
34
+ commit_message : Declare alpha stable
35
+ branch : dev
36
+ - name : Push dev -> master
37
+ uses : ad-m/github-push-action@master
38
+ with :
39
+ github_token : ${{ secrets.GITHUB_TOKEN }}
40
+ branch : master
41
+ force : true
42
+ - name : version
43
+ run : echo "::set-output name=version::$(python setup.py --version)"
44
+ id : version
45
+ - name : Create Release
46
+ id : create_release
47
+ uses : actions/create-release@v1
48
+ env :
49
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
50
+ with :
51
+ tag_name : V${{ steps.version.outputs.version }}
52
+ release_name : Release ${{ steps.version.outputs.version }}
53
+ body : |
54
+ Changes in this Release
55
+ ${{ steps.changelog.outputs.changelog }}
56
+ draft : false
57
+ prerelease : false
58
+ - name : Build Distribution Packages
59
+ run : |
60
+ python setup.py bdist_wheel
61
+ - name : Prepare next Major version
62
+ run : echo "::set-output name=version::$(python setup.py --version)"
63
+ id : alpha
64
+ - name : Increment Version ${{ steps.alpha.outputs.version }}Alpha0
65
+ run : |
66
+ VER=$(python setup.py --version)
67
+ python scripts/bump_major.py
68
+ - name : Commit to dev
69
+ uses : stefanzweifel/git-auto-commit-action@v4
70
+ with :
71
+ commit_message : Prepare Next Version
72
+ branch : dev
73
+ - name : Publish to Test PyPI
74
+ uses : pypa/gh-action-pypi-publish@master
75
+ with :
76
+ password : ${{secrets.PYPI_TOKEN}}
0 commit comments