Skip to content

Commit

Permalink
fix(build): Run publish pipeline on tags
Browse files Browse the repository at this point in the history
This *implies* that release-please creates those corresponding tags.
It dilutes the pipeline a bit and makes it less clear/linear.
However, it also allows publishing on manual tag pushes, not just releases.
Not that that should ever be done...
  • Loading branch information
alexpovel committed Sep 4, 2022
1 parent e1fed1b commit a171597
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
push:
branches:
- main
tags:
- "v*"
pull_request:
branches:
- main
Expand Down Expand Up @@ -83,9 +85,6 @@ jobs:
runs-on: ubuntu-latest
needs: tests

outputs:
created: ${{ steps.release.outputs.release_created }}

steps:
- uses: google-github-actions/release-please-action@v3
id: release
Expand All @@ -97,8 +96,8 @@ jobs:
name: Publish to PyPI

runs-on: ubuntu-latest
needs: release-please
if: ${{ needs.release-please.outputs.created }}
needs: tests
if: ${{ github.ref_type == 'tag' }}

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -129,8 +128,8 @@ jobs:
name: Build Docker image and push to GitHub Container Registry

runs-on: ubuntu-latest
needs: release-please
if: ${{ needs.release-please.outputs.created }}
needs: tests
if: ${{ github.ref_type == 'tag' }}

permissions:
contents: read
Expand Down

0 comments on commit a171597

Please sign in to comment.