@@ -79,35 +79,35 @@ jobs:
79
79
- name : Build a binary wheel and a source tarball
80
80
run : python -m build --sdist --wheel --outdir dist/ .
81
81
- name : Publish distribution to Test PyPI
82
- if : ${{ ! startsWith( github.ref, 'refs/tags') }}
82
+ if : ${{ github.ref_type != 'tag' }}
83
83
uses : pypa/gh-action-pypi-publish@release/v1
84
84
with :
85
85
password : ${{ secrets.TEST_PYPI_API_TOKEN }}
86
86
repository_url : https://test.pypi.org/legacy/
87
87
- name : Publish distribution to PyPI
88
- if : startsWith( github.ref, 'refs/tags')
88
+ if : ${{ github.ref_type == 'tag' }}
89
89
uses : pypa/gh-action-pypi-publish@release/v1
90
90
with :
91
91
password : ${{ secrets.PYPI_API_TOKEN }}
92
92
- name : Create release on GitHub
93
93
id : create_release
94
- if : startsWith( github.ref, 'refs/tags')
94
+ if : ${{ github.ref_type == 'tag' }}
95
95
uses : actions/create-release@v1
96
96
env :
97
97
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
98
98
with :
99
- tag_name : ${{ github.ref }}
100
- release_name : ${{ github.ref }}
99
+ tag_name : ${{ github.ref_name }}
100
+ release_name : ${{ github.ref_name }}
101
101
draft : false
102
102
prerelease : false
103
103
- name : Add sdist to release
104
104
id : upload-release-asset
105
- if : startsWith( github.ref, 'refs/tags')
105
+ if : ${{ github.ref_type == 'tag' }}
106
106
uses : actions/upload-release-asset@v1
107
107
env :
108
108
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
109
109
with :
110
110
upload_url : ${{ steps.create_release.outputs.upload_url }}
111
- asset_path : ./dist/git-pw-${{ github.ref }}.tar.gz
112
- asset_name : git-pw-${{ github.ref }}.tar.gz
111
+ asset_path : ./dist/git-pw-${{ github.ref_name }}.tar.gz
112
+ asset_name : git-pw-${{ github.ref_name }}.tar.gz
113
113
asset_content_type : application/gzip
0 commit comments