Skip to content

Commit

Permalink
Merge branch 'dev' into pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
  • Loading branch information
project-defiant authored Dec 17, 2024
2 parents 01c1f0b + 24dfc9f commit 13b8c96
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
release:
runs-on: ubuntu-latest
concurrency: release
outputs:
released: ${{ steps.semrelease.outputs.released }}
permissions:
# NOTE: this enables trusted publishing.
# See https://github.com/pypa/gh-action-pypi-publish/tree/release/v1#trusted-publishing
Expand Down Expand Up @@ -46,7 +48,8 @@ jobs:

- name: Publish package to GitHub Release
uses: python-semantic-release/upload-to-gh-release@main
if: ${{ steps.semrelease.outputs.released }} == 'true'
# NOTE: semrelease output is a string, so we need to compare it to a string
if: steps.semrelease.outputs.released == 'true'
with:
# NOTE: allow to start the workflow when push action on tag gets executed
# requires using GH_APP to authenitcate, otherwise push authorised with
Expand All @@ -56,16 +59,16 @@ jobs:
tag: ${{ steps.semrelease.outputs.tag }}

- name: Store the distribution packages
if: steps.semrelease.outputs.released == 'true'
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
needs: release
name: >-
Publish 📦 in PyPI
if: github.ref == 'refs/heads/main'
name: Publish 📦 in PyPI
if: github.ref == 'refs/heads/main' && needs.release.outputs.released == 'true'
runs-on: ubuntu-latest
environment:
name: pypi
Expand All @@ -84,7 +87,7 @@ jobs:
publish-to-testpypi:
name: Publish 📦 in TestPyPI
needs: release
if: github.ref != 'refs/heads/main'
if: github.ref == 'refs/heads/main' && needs.release.outputs.released == 'true'
runs-on: ubuntu-latest

environment:
Expand All @@ -108,7 +111,7 @@ jobs:
documentation:
needs: release
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
if: github.ref == 'refs/heads/main' && needs.release.outputs.released == 'true'
steps:
- uses: actions/checkout@v4
with:
Expand Down

0 comments on commit 13b8c96

Please sign in to comment.