Skip to content

Commit

Permalink
CI: Use modern contexts
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Finucane <stephen@that.guru>
  • Loading branch information
stephenfin committed May 4, 2023
1 parent 8c805c4 commit f4beae7
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,35 +79,35 @@ jobs:
- name: Build a binary wheel and a source tarball
run: python -m build --sdist --wheel --outdir dist/ .
- name: Publish distribution to Test PyPI
if: ${{ ! startsWith(github.ref, 'refs/tags') }}
if: ${{ github.ref_type != 'tag' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Publish distribution to PyPI
if: startsWith(github.ref, 'refs/tags')
if: ${{ github.ref_type == 'tag' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Create release on GitHub
id: create_release
if: startsWith(github.ref, 'refs/tags')
if: ${{ github.ref_type == 'tag' }}
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
tag_name: ${{ github.ref_name }}
release_name: ${{ github.ref_name }}
draft: false
prerelease: false
- name: Add sdist to release
id: upload-release-asset
if: startsWith(github.ref, 'refs/tags')
if: ${{ github.ref_type == 'tag' }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/git-pw-${{ github.ref }}.tar.gz
asset_name: git-pw-${{ github.ref }}.tar.gz
asset_path: ./dist/git-pw-${{ github.ref_name }}.tar.gz
asset_name: git-pw-${{ github.ref_name }}.tar.gz
asset_content_type: application/gzip

0 comments on commit f4beae7

Please sign in to comment.