From 8c6eb595a71e2f1ea2c78cb4c27abcb33c236826 Mon Sep 17 00:00:00 2001 From: Luke Hazelton <108833341+hazeltonl@users.noreply.github.com> Date: Wed, 20 Nov 2024 11:18:19 -0500 Subject: [PATCH 1/4] Add moving Minor version tag --- .github/workflows/release.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b5d64102c..0b2b8bf1d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,8 +9,10 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Update v4 tag - run: git tag -f v4 + - name: Update v4 tags + run: | + git tag -f v4 + git tag -f v4.4 - name: Push changes uses: ad-m/github-push-action@master with: From fb9b01a580fc4c416cae5f6daa169136ba354162 Mon Sep 17 00:00:00 2001 From: Luke Hazelton Date: Wed, 20 Nov 2024 13:23:50 -0500 Subject: [PATCH 2/4] convert release workflow --- .github/workflows/release.yml | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0b2b8bf1d..95a626cfd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,7 +1,19 @@ name: "Release" on: - release: - types: [published] + workflow_dispatch: + inputs: + major: + description: 'MAJOR semantic severity' + required: true + type: string + minor: + description: 'Minor semantic severity' + required: true + type: string + patch: + description: 'patch semantic severity' + required: true + type: string jobs: release: @@ -9,10 +21,16 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Update v4 tags + - name: GitHub Release + uses: ncipollo/release-action@v1 + with: + tag: v${{ inputs.major }}.${{ inputs.minor }}.${{ inputs.patch }} + allowUpdates: true + generateReleaseNotes: true + - name: Update tags run: | - git tag -f v4 - git tag -f v4.4 + git tag -f v${{ inputs.major }} + git tag -f v${{ inputs.major }}.${{ inputs.minor }} - name: Push changes uses: ad-m/github-push-action@master with: From 1e7bfb41c211ee47762094b2fa0f7cb067e9bb38 Mon Sep 17 00:00:00 2001 From: Luke Hazelton <108833341+hazeltonl@users.noreply.github.com> Date: Tue, 7 Jan 2025 09:59:59 -0500 Subject: [PATCH 3/4] Tag Minor versions but allow for editing release notes at creation --- .github/workflows/release.yml | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 95a626cfd..1b4df8814 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,19 +1,7 @@ name: "Release" on: - workflow_dispatch: - inputs: - major: - description: 'MAJOR semantic severity' - required: true - type: string - minor: - description: 'Minor semantic severity' - required: true - type: string - patch: - description: 'patch semantic severity' - required: true - type: string + release: + types: [published] jobs: release: @@ -21,16 +9,10 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: GitHub Release - uses: ncipollo/release-action@v1 - with: - tag: v${{ inputs.major }}.${{ inputs.minor }}.${{ inputs.patch }} - allowUpdates: true - generateReleaseNotes: true - name: Update tags run: | - git tag -f v${{ inputs.major }} - git tag -f v${{ inputs.major }}.${{ inputs.minor }} + git tag -f v4 + git tag -f v4.4 - name: Push changes uses: ad-m/github-push-action@master with: From 0dc04e78742b0dd617677bcccb7cee6b88df027e Mon Sep 17 00:00:00 2001 From: Luke Hazelton <108833341+hazeltonl@users.noreply.github.com> Date: Tue, 7 Jan 2025 10:30:07 -0500 Subject: [PATCH 4/4] Update .github/workflows/release.yml Co-authored-by: Eyal Delarea --- .github/workflows/release.yml | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1b4df8814..bfd371a87 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,10 +9,28 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Update tags + - name: Extract Major and Minor Versions from Tag + id: extract-version run: | - git tag -f v4 - git tag -f v4.4 + TAG_NAME="${{ github.event.release.tag_name }}" + # Ensure the tag follows semantic versioning (e.g., v1.2.3) + if [[ "$TAG_NAME" =~ ^v([0-9]+)\.([0-9]+) ]]; then + MAJOR="${BASH_REMATCH[1]}" + MINOR="${BASH_REMATCH[2]}" + echo "MAJOR=$MAJOR" >> $GITHUB_ENV + echo "MINOR=$MINOR" >> $GITHUB_ENV + echo "Extracted Major: $MAJOR, Minor: $MINOR" + else + echo "Invalid tag format: $TAG_NAME" + exit 1 + fi + + - name: Update Major and Minor Tags + run: | + # Create or update major version tag + git tag -f v$MAJOR + # Create or update minor version tag + git tag -f v$MAJOR.$MINOR - name: Push changes uses: ad-m/github-push-action@master with: