Skip to content

Commit

Permalink
Merge pull request #1417 from o1-labs/feat/delete-tag-and-branch-release
Browse files Browse the repository at this point in the history
feat(release.yml): add steps to delete existing release tag and branch
  • Loading branch information
MartinMinkov authored Feb 6, 2024
2 parents 4317116 + 521e2a5 commit 3fe3392
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Bump patch version
run: |
git fetch --prune --unshallow
git fetch --prune --unshallow --tags --force
NEW_VERSION=$(npm version patch)
echo "New version: $NEW_VERSION"
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
Expand All @@ -57,6 +57,19 @@ jobs:
git add CHANGELOG.md
git commit -m "Update CHANGELOG for new version $NEW_VERSION"
- name: Delete existing release tag
run: |
if git rev-parse $NEW_VERSION >/dev/null 2>&1; then
git tag -d $NEW_VERSION
git push origin :refs/tags/$NEW_VERSION
fi
- name: Delete existing release branch
run: |
if git ls-remote --heads origin release/${NEW_VERSION} | grep release/${NEW_VERSION}; then
git push origin --delete release/${NEW_VERSION}
fi
- name: Create new release branch
run: |
NEW_BRANCH="release/${NEW_VERSION}"
Expand Down

0 comments on commit 3fe3392

Please sign in to comment.