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
3
5
4
6
name : Upload Python Package to test.pypi.org
5
7
@@ -12,55 +14,56 @@ jobs:
12
14
test-deploy :
13
15
runs-on : ubuntu-latest
14
16
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 be_upy_blink/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 be_upy_blink/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
45
+ # for artifact name due to unallowed '/'
46
+ name : dist_repo.${{ github.event.repository.name }}_sha.${{ github.sha }}_build.${{ github.run_number }}
47
+ path : dist/*.tar.gz
48
+ retention-days : 14
49
+ - name : Publish package
50
+ uses : pypa/gh-action-pypi-publish@release/v1.5
51
+ with :
52
+ repository_url : https://test.pypi.org/legacy/
53
+ password : ${{ secrets.TEST_PYPI_API_TOKEN }}
54
+ skip_existing : true
55
+ verbose : true
56
+ print_hash : true
57
+ - name : ' Create changelog based prerelease'
58
+ uses : brainelectronics/changelog-based-release@v1
59
+ with :
60
+ # note you'll typically need to create a personal access token
61
+ # with permissions to create releases in the other repo
62
+ # or you set the "contents" permissions to "write" as in this example
63
+ changelog-path : changelog.md
64
+ tag-name-prefix : ' '
65
+ tag-name-extension : ' -rc${{ github.run_number }}.dev${{ github.event.number }}'
66
+ release-name-prefix : ' '
67
+ release-name-extension : ' -rc${{ github.run_number }}.dev${{ github.event.number }}'
68
+ draft-release : true
69
+ prerelease : true
0 commit comments