Skip to content

Commit

Permalink
feat: handle existing major release
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekRoberts committed Nov 27, 2024
1 parent a3c5680 commit e5935cb
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,30 +34,25 @@ jobs:
with:
token: ${{ github.token }}

- name: Git Setup
if: ${{ steps.semver.outputs.next }}
run: |
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git config --global user.name "${GITHUB_ACTOR}"
git checkout -b ${{ env.branch }}
- name: Rebuild ./dist
if: ${{ steps.semver.outputs.next }}
run: |
npm run dist
git add ./dist --force
git commit -m "Rebuild dist/ directory"
- name: Semver Release
- name: Setup and Tag
if: ${{ steps.semver.outputs.next }}
env:
GH_TOKEN: ${{ github.token }}
tag_semver: ${{ steps.semver.outputs.next }}
run: |
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git config --global user.name "${GITHUB_ACTOR}"
git checkout -b ${{ env.branch }}
git push -u origin HEAD:${{ env.branch }}
git tag ${{ env.tag_semver }}
git push origin tag ${{ env.tag_semver }}
# gh release create ${{ env.tag_semver }} --title ${{ env.tag_semver }} --generate-notes
git tag -f ${{ env.tag_semver }}
git push -f origin tag ${{ env.tag_semver }}
- name: Major Release
if: ${{ steps.semver.outputs.next }}
Expand All @@ -72,6 +67,18 @@ jobs:
gh release create ${{ env.tag_major }} --title ${{ env.tag_major }}
fi
- name: Semver Release
if: ${{ steps.semver.outputs.next }}
env:
GH_TOKEN: ${{ github.token }}
tag_semver: ${{ steps.semver.outputs.next }}
tag_major: ${{ steps.semver.outputs.nextMajor }}
run: |
if [ $(gh release view ${{ env.tag_semver }} --json name -q .name) ]; then
gh release delete ${{ env.tag_semver }} --yes
fi
gh release create ${{ env.tag_semver }} --title ${{ env.tag_semver }} --generate-notes
- name: Cleanup
if: always() && ${{ steps.semver.outputs.next }}
run: |
Expand Down

0 comments on commit e5935cb

Please sign in to comment.