Skip to content

Commit

Permalink
ci: pass tag output and conditionally execute publish steps
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardcooke53 committed Jun 11, 2023
1 parent 01fa1b6 commit d568c69
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/v8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ jobs:
- name: Get new SHA
id: sha
run: |
new_sha=$(git rev-parse HEAD)
echo "SHA=$new_sha" >> $GITHUB_OUTPUT
new_sha="$(git rev-parse HEAD)"
echo "SHA=$new_sha" >> "$GITHUB_OUTPUT"
release:
name: Semantic Release
Expand All @@ -115,6 +115,7 @@ jobs:
fetch-depth: 0
ref: ${{ github.ref_name }}
- name: Python Semantic Release
id: release
uses: ./
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -124,13 +125,18 @@ jobs:
# This will need converting to use trusted publishing at a later date
# see https://docs.pypi.org/trusted-publishers/
- name: Publish package distributions to PyPI
id: pypi-publish
if: ${{ steps.release.outputs.released }} == 'true'
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
user: ${{ secrets.PYPI_USERNAME }}
password: ${{ secrets.PYPI_PASSWORD }}

- name: Publish package distributions to GitHub Releases
id: github-release
if: ${{ steps.release.outputs.released }} == 'true'
uses: python-semantic-release/upload-to-gh-release@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.release.outputs.tag }}

0 comments on commit d568c69

Please sign in to comment.