Skip to content

Commit

Permalink
fix: release drafter
Browse files Browse the repository at this point in the history
  • Loading branch information
gatoniel committed Oct 22, 2024
1 parent 64a2c78 commit c5c6e73
Showing 1 changed file with 37 additions and 6 deletions.
43 changes: 37 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ on:
push:
branches:
- main
- release-drafter

jobs:
release:
name: Release
build:
name: Build
runs-on: ubuntu-latest
outputs:
version-tag: ${{ steps.check-version.outputs.tag }}
environment:
name: pypi
url: https://pypi.org/p/merge-stardist-masks
Expand Down Expand Up @@ -59,20 +62,48 @@ jobs:
run: |
poetry build --ansi
- name: Save build as artifact
uses: actions/upload-artifact@v4
with:
name: build
path: "dist/"

publish:
name: Publish
runs-on: ubuntu-latest
needs: build
environment:
name: pypi
url: https://pypi.org/p/merge-stardist-masks
permissions:
id-token: write
steps:
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: build

- name: Publish package on PyPI
if: steps.check-version.outputs.tag
if: needs.build.outputs.version-tag
uses: pypa/[email protected]

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

release-draft:
name: Release drafter
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
steps:
- name: Publish the release notes
uses: release-drafter/[email protected]
with:
publish: ${{ steps.check-version.outputs.tag != '' }}
tag: ${{ steps.check-version.outputs.tag }}
publish: ${{ needs.build.outputs.version-tag != '' }}
tag: ${{ needs.build.outputs.version-tag }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit c5c6e73

Please sign in to comment.