1- # this file is *not* meant to cover or endorse the use of GitHub Actions, but rather to
2- # help make automated releases for this project
1+ ---
2+
3+ # this file is *not* meant to cover or endorse the use of GitHub Actions, but
4+ # rather to help make automated test releases for this project
35
46name : Upload Python Package to test.pypi.org
57
@@ -12,55 +14,55 @@ jobs:
1214 test-deploy :
1315 runs-on : ubuntu-latest
1416 steps :
15- - name : Checkout
16- uses : actions/checkout@v3
17- - name : Set up Python
18- uses : actions/setup-python@v3
19- with :
20- python-version : ' 3.9'
21- - name : Install build dependencies
22- run : |
23- if [ -f requirements-deploy.txt ]; then pip install -r requirements-deploy.txt; fi
24- - name : Build package
25- run : |
26- changelog2version \
27- --changelog_file changelog.md \
28- --version_file umodbus/version.py \
29- --version_file_type py \
30- --additional_version_info="-rc${{ github.run_number }}.dev${{ github.event.number }}" \
31- --debug
32- python setup.py sdist
33- - name : Test built package
34- # sdist call creates non twine conform "*.orig" files, remove them
35- run : |
36- rm dist/*.orig
37- twine check dist/*.tar.gz
38- - name : Archive build package artifact
39- uses : actions/upload-artifact@v3
40- with :
41- # https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
42- # ${{ github.repository }} and ${{ github.ref_name }} can't be used for artifact name due to unallowed '/'
43- name : dist_repo.${{ github.event.repository.name }}_sha.${{ github.sha }}_build.${{ github.run_number }}
44- path : dist/*.tar.gz
45- retention-days : 14
46- - name : Publish package
47- uses : pypa/gh-action-pypi-publish@release/v1.5
48- with :
49- repository_url : https://test.pypi.org/legacy/
50- password : ${{ secrets.TEST_PYPI_API_TOKEN }}
51- skip_existing : true
52- verbose : true
53- print_hash : true
54- - name : ' Create changelog based prerelease'
55- uses : brainelectronics/changelog-based-release@v1
56- with :
57- # note you'll typically need to create a personal access token
58- # with permissions to create releases in the other repo
59- # or you set the "contents" permissions to "write" as in this example
60- changelog-path : changelog.md
61- tag-name-prefix : ' '
62- tag-name-extension : ' -rc${{ github.run_number }}.dev${{ github.event.number }}'
63- release-name-prefix : ' '
64- release-name-extension : ' -rc${{ github.run_number }}.dev${{ github.event.number }}'
65- draft-release : true
66- prerelease : true
17+ - name : Checkout
18+ uses : actions/checkout@v3
19+ - name : Set up Python
20+ uses : actions/setup-python@v3
21+ with :
22+ python-version : ' 3.9'
23+ - name : Install build dependencies
24+ run : |
25+ if [ -f requirements-deploy.txt ]; then pip install -r requirements-deploy.txt; fi
26+ - name : Build package
27+ run : |
28+ changelog2version \
29+ --changelog_file changelog.md \
30+ --version_file umodbus/version.py \
31+ --version_file_type py \
32+ --additional_version_info="-rc${{ github.run_number }}.dev${{ github.event.number }}" \
33+ --debug
34+ python setup.py sdist
35+ - name : Test built package
36+ # sdist call creates non twine conform "*.orig" files, remove them
37+ run : |
38+ rm dist/*.orig
39+ twine check dist/*.tar.gz
40+ - name : Archive build package artifact
41+ uses : actions/upload-artifact@v3
42+ with :
43+ # https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
44+ # ${{ github.repository }} and ${{ github.ref_name }} can't be used for artifact name due to unallowed '/'
45+ name : dist_repo.${{ github.event.repository.name }}_sha.${{ github.sha }}_build.${{ github.run_number }}
46+ path : dist/*.tar.gz
47+ retention-days : 14
48+ - name : Publish package
49+ uses : pypa/gh-action-pypi-publish@release/v1.5
50+ with :
51+ repository_url : https://test.pypi.org/legacy/
52+ password : ${{ secrets.TEST_PYPI_API_TOKEN }}
53+ skip_existing : true
54+ verbose : true
55+ print_hash : true
56+ - name : ' Create changelog based prerelease'
57+ uses : brainelectronics/changelog-based-release@v1
58+ with :
59+ # note you'll typically need to create a personal access token
60+ # with permissions to create releases in the other repo
61+ # or you set the "contents" permissions to "write" as in this example
62+ changelog-path : changelog.md
63+ tag-name-prefix : ' '
64+ tag-name-extension : ' -rc${{ github.run_number }}.dev${{ github.event.number }}'
65+ release-name-prefix : ' '
66+ release-name-extension : ' -rc${{ github.run_number }}.dev${{ github.event.number }}'
67+ draft-release : true
68+ prerelease : true
0 commit comments