Skip to content

Commit

Permalink
Remove + recreate major and minor versions (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vadorequest authored Jan 10, 2023
1 parent 7a013ba commit f13f541
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 19 deletions.
29 changes: 19 additions & 10 deletions .github/workflows/auto-git-release-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#
# See https://github.com/PaulHatch/semantic-version https://github.com/PaulHatch/semantic-version/tree/v5.0.2
# See https://github.com/softprops/action-gh-release https://github.com/softprops/action-gh-release/tree/v1
# See https://github.com/Actions-R-Us/actions-tagger https://github.com/Actions-R-Us/actions-tagger/releases/tag/v2.0.3

name: 'Auto release'
on:
Expand All @@ -21,6 +20,8 @@ jobs:
with:
fetch-depth: 0 # Force fetch all commits - See https://github.com/PaulHatch/semantic-version#important-note-regarding-the-checkout-action

- run: "echo \"GITHUB_SHA: ${{ github.sha }}\""

# Outputs documentation: https://github.com/PaulHatch/semantic-version/blob/master/src/main.ts#L22-L33
- name: Resolving next Release Candidate version using semantic-version
uses: paulhatch/[email protected]
Expand Down Expand Up @@ -56,7 +57,7 @@ jobs:
--title "${{steps.next_semantic_version.outputs.version_tag}}" \
--latest \
--generate-notes \
--target $GITHUB_SHA
--target "${{github.sha}}"
env:
GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

Expand All @@ -76,17 +77,21 @@ jobs:
gh release create v${{steps.next_semantic_version.outputs.major}} \
--title "v${{steps.next_semantic_version.outputs.major}} MAJOR release (auto-updated)" \
--generate-notes \
--target $GITHUB_SHA
--target "${{github.sha}}"
env:
GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

# See https://cli.github.com/manual/gh_release_edit
- name: Updating existing release for the major "v${{steps.next_semantic_version.outputs.major}}" version
- name: Recreating existing release for the major "v${{steps.next_semantic_version.outputs.major}}" version
if: ${{ steps.majorTagExists.outputs.exists == 'true' }}
run: |
gh release edit v${{steps.next_semantic_version.outputs.major}} \
# Delete and create the release again
gh release delete v${{steps.next_semantic_version.outputs.major}} --cleanup-tag --yes
gh release create v${{steps.next_semantic_version.outputs.major}} \
--title "v${{steps.next_semantic_version.outputs.major}} MAJOR release (auto-updated)" \
--target $GITHUB_SHA
--generate-notes \
--target "${{github.sha}}"
env:
GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

Expand All @@ -106,16 +111,20 @@ jobs:
gh release create v${{steps.next_semantic_version.outputs.major}}.${{steps.next_semantic_version.outputs.minor}} \
--title "v${{steps.next_semantic_version.outputs.major}}.${{steps.next_semantic_version.outputs.minor}} MINOR release (auto-updated)" \
--generate-notes \
--target $GITHUB_SHA
--target "${{github.sha}}"
env:
GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

# See https://cli.github.com/manual/gh_release_edit
- name: Updating existing release for the minor "v${{steps.next_semantic_version.outputs.major}}.${{steps.next_semantic_version.outputs.minor}}" version
- name: Recreating existing release for the minor "v${{steps.next_semantic_version.outputs.major}}.${{steps.next_semantic_version.outputs.minor}}" version
if: ${{ steps.minorTagExists.outputs.exists == 'true' }}
run: |
gh release edit v${{steps.next_semantic_version.outputs.major}}.${{steps.next_semantic_version.outputs.minor}} \
# Delete and create the release again
gh release delete v${{steps.next_semantic_version.outputs.major}}.${{steps.next_semantic_version.outputs.minor}} --cleanup-tag --yes
gh release create v${{steps.next_semantic_version.outputs.major}}.${{steps.next_semantic_version.outputs.minor}} \
--title "v${{steps.next_semantic_version.outputs.major}}.${{steps.next_semantic_version.outputs.minor}} MINOR release (auto-updated)" \
--target $GITHUB_SHA
--generate-notes \
--target "${{github.sha}}"
env:
GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
29 changes: 20 additions & 9 deletions .github/workflows/auto-git-release-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@ jobs:
tag-and-release:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Fetching all commits for the current branch
uses: actions/checkout@v3
with:
fetch-depth: 0 # Force fetch all commits - See https://github.com/PaulHatch/semantic-version#important-note-regarding-the-checkout-action

- run: "echo \"GITHUB_SHA: ${{ github.sha }}\""

# Outputs documentation: https://github.com/PaulHatch/semantic-version/blob/master/src/main.ts#L22-L33
- name: Resolving next Release Candidate version using semantic-version
uses: paulhatch/[email protected]
Expand Down Expand Up @@ -65,18 +68,22 @@ jobs:
--title "v${{steps.next_semantic_version.outputs.major}}-rc MAJOR release (auto-updated)" \
--generate-notes \
--prerelease \
--target $GITHUB_SHA
--target "${{github.sha}}"
env:
GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

# See https://cli.github.com/manual/gh_release_edit
- name: Updating existing release for the major "v${{steps.next_semantic_version.outputs.major}}-rc" version
- name: Recreating existing release for the major "v${{steps.next_semantic_version.outputs.major}}-rc" version
if: ${{ steps.majorTagExists.outputs.exists == 'true' }}
run: |
gh release edit v${{steps.next_semantic_version.outputs.major}}-rc \
# Delete and create the release again
gh release delete v${{steps.next_semantic_version.outputs.major}}-rc --cleanup-tag --yes
gh release create v${{steps.next_semantic_version.outputs.major}}-rc \
--title "v${{steps.next_semantic_version.outputs.major}}-rc MAJOR release (auto-updated)" \
--generate-notes \
--prerelease \
--target $GITHUB_SHA
--target "${{github.sha}}"
env:
GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

Expand All @@ -97,17 +104,21 @@ jobs:
--title "v${{steps.next_semantic_version.outputs.major}}.${{steps.next_semantic_version.outputs.minor}}-rc MINOR release (auto-updated)" \
--generate-notes \
--prerelease \
--target $GITHUB_SHA
--target "${{github.sha}}"
env:
GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

# See https://cli.github.com/manual/gh_release_edit
- name: Updating existing release for the minor "v${{steps.next_semantic_version.outputs.major}}.${{steps.next_semantic_version.outputs.minor}}-rc" version
- name: Recreating existing release for the minor "v${{steps.next_semantic_version.outputs.major}}.${{steps.next_semantic_version.outputs.minor}}-rc" version
if: ${{ steps.minorTagExists.outputs.exists == 'true' }}
run: |
gh release edit v${{steps.next_semantic_version.outputs.major}}.${{steps.next_semantic_version.outputs.minor}}-rc \
# Delete and create the release again
gh release delete v${{steps.next_semantic_version.outputs.major}}.${{steps.next_semantic_version.outputs.minor}}-rc --cleanup-tag --yes
gh release create v${{steps.next_semantic_version.outputs.major}}.${{steps.next_semantic_version.outputs.minor}}-rc \
--title "v${{steps.next_semantic_version.outputs.major}}.${{steps.next_semantic_version.outputs.minor}}-rc MINOR release (auto-updated)" \
--generate-notes \
--prerelease \
--target $GITHUB_SHA
--target "${{github.sha}}"
env:
GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

0 comments on commit f13f541

Please sign in to comment.