Skip to content

Commit

Permalink
ci: once and for all FIX release pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
bruno-fs committed Aug 15, 2024
1 parent e22dc76 commit 5659932
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ jobs:
url: https://pypi.org/p/django-json-agg
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
contents: write # Required for pushing tags - https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#permissions
steps:
- name: Check out the repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 2

Expand Down Expand Up @@ -49,14 +50,14 @@ jobs:
- name: Tag new version if it doesn't exist
id: tag-version
if: steps.check-version.outputs.version
uses: butlerlogic/action-autotag@1.1.3 # don't update until https://github.com/ButlerLogic/action-autotag/issues/49 is fixed
uses: bruno-fs/repo-tagger@1.0.0
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
version: "${{ steps.check-version.outputs.version }}"
tag: "${{ steps.check-version.outputs.version }}"

- name: Bump version for developmental release
if: "! steps.tag-version.outputs.tagname"
if: "! steps.tag-version.outputs.tag"
run: |
poetry version patch &&
version=$(poetry version -s) &&
Expand All @@ -67,19 +68,19 @@ jobs:
poetry build --ansi
- name: Publish package on PyPI
if: steps.tag-version.outputs.tagname
if: steps.tag-version.outputs.tag
uses: pypa/[email protected]

- name: Publish package on TestPyPI
if: "! steps.tag-version.outputs.tagname"
if: "! steps.tag-version.outputs.tag"
uses: pypa/[email protected]
with:
repository-url: https://test.pypi.org/legacy/

- name: Publish the release notes
uses: release-drafter/[email protected]
with:
publish: ${{ steps.tag-version.outputs.tagname != '' }}
tag: ${{ steps.tag-version.outputs.tagname }}
publish: ${{ steps.tag-version.outputs.tag != '' }}
tag: ${{ steps.tag-version.outputs.tag }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 5659932

Please sign in to comment.