Skip to content

Commit f4beae7

Browse files
committed
CI: Use modern contexts
Signed-off-by: Stephen Finucane <[email protected]>
1 parent 8c805c4 commit f4beae7

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

.github/workflows/ci.yaml

+8-8
Original file line numberDiff line numberDiff line change
@@ -79,35 +79,35 @@ jobs:
7979
- name: Build a binary wheel and a source tarball
8080
run: python -m build --sdist --wheel --outdir dist/ .
8181
- name: Publish distribution to Test PyPI
82-
if: ${{ ! startsWith(github.ref, 'refs/tags') }}
82+
if: ${{ github.ref_type != 'tag' }}
8383
uses: pypa/gh-action-pypi-publish@release/v1
8484
with:
8585
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
8686
repository_url: https://test.pypi.org/legacy/
8787
- name: Publish distribution to PyPI
88-
if: startsWith(github.ref, 'refs/tags')
88+
if: ${{ github.ref_type == 'tag' }}
8989
uses: pypa/gh-action-pypi-publish@release/v1
9090
with:
9191
password: ${{ secrets.PYPI_API_TOKEN }}
9292
- name: Create release on GitHub
9393
id: create_release
94-
if: startsWith(github.ref, 'refs/tags')
94+
if: ${{ github.ref_type == 'tag' }}
9595
uses: actions/create-release@v1
9696
env:
9797
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9898
with:
99-
tag_name: ${{ github.ref }}
100-
release_name: ${{ github.ref }}
99+
tag_name: ${{ github.ref_name }}
100+
release_name: ${{ github.ref_name }}
101101
draft: false
102102
prerelease: false
103103
- name: Add sdist to release
104104
id: upload-release-asset
105-
if: startsWith(github.ref, 'refs/tags')
105+
if: ${{ github.ref_type == 'tag' }}
106106
uses: actions/upload-release-asset@v1
107107
env:
108108
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
109109
with:
110110
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
113113
asset_content_type: application/gzip

0 commit comments

Comments
 (0)