Skip to content

Commit

Permalink
Fix release pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
johlju committed Sep 8, 2024
1 parent f7f8966 commit dd618e4
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/build-push-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,27 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This is needed for the gh cli

# Create a preview tag if on the main branch
# Create a preview tag if on the main branch and dist has changed
- name: Create Preview Tag
if: github.ref == 'refs/heads/main'
if: github.ref == 'refs/heads/main' && steps.check_dist_changes.outputs.dist_changed == 'true'
run: |
git tag v${{ steps.gitversion.outputs.semVer }}
git push origin v${{ steps.gitversion.outputs.semVer }}
# Create Release if on a release branch
# Create a draft release for the preview tag if on the main branch and dist has changed
- name: Create Draft Release
if: github.ref == 'refs/heads/main' && steps.check_dist_changes.outputs.dist_changed == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create v${{ steps.gitversion.outputs.semVer }} \
--title "Preview Release ${{ steps.gitversion.outputs.semVer }}" \
--notes "This is a preview release for version ${{ steps.gitversion.outputs.semVer }}." \
--draft
# Create Release if on a release branch and dist has changed
- name: Create Release
if: startsWith(github.ref, 'refs/heads/releases/')
if: startsWith(github.ref, 'refs/heads/releases/') && steps.check_dist_changes.outputs.dist_changed == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand Down

0 comments on commit dd618e4

Please sign in to comment.