From 84ae6a0c27cc0f990ca2387c0a9fd1e627a10813 Mon Sep 17 00:00:00 2001 From: Jen Duong Date: Wed, 30 Jul 2025 15:10:40 +0100 Subject: [PATCH 1/6] echo MajorMinorPatch --- .github/workflows/get-version.yml | 44 +++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/get-version.yml diff --git a/.github/workflows/get-version.yml b/.github/workflows/get-version.yml new file mode 100644 index 0000000000..43f187a471 --- /dev/null +++ b/.github/workflows/get-version.yml @@ -0,0 +1,44 @@ +name: get-version.yml +on: + pull_request: + branches: + - main + +jobs: + calculate-version: + runs-on: ubuntu-latest + outputs: + semVer: ${{ steps.gitversion.outputs.semVer }} + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + branches: main + + - name: Install GitVersion + uses: gittools/actions/gitversion/setup@v0.9.7 + with: + versionSpec: "5.x" + + - name: Determine Version + id: gitversion + uses: gittools/actions/gitversion/execute@v0.9.7 + + assign-semver: + runs-on: ubuntu-latest + needs: [calculate-version] + env: + SEMVER: ${{ needs.calculate-version.outputs.semVer }} + MAJOR: ${{ needs.calculate-version.outputs.Major }} + MMP: ${{ needs.calculate-version.outputs.MajorMinorPatch }} + outputs: + SEMVER: ${{ steps.calc-semver.outputs.semver }} + steps: + - run: echo $MMP + - run: echo $SEMVER + - name: Add 3 to calculated semver + run: | + echo SEMVER="$((3 + MAJOR))${SEMVER:1}" >> $GITHUB_ENV + - name: Set semver to output + id: calc-semver + run: echo "::set-output name=semver::$(echo $SEMVER)" From 7ca8ff32f333c21413a117cb73ab63320f0e05db Mon Sep 17 00:00:00 2001 From: Jen Duong Date: Wed, 30 Jul 2025 15:13:55 +0100 Subject: [PATCH 2/6] echo major minor patch --- .github/workflows/get-version.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/get-version.yml b/.github/workflows/get-version.yml index 43f187a471..6bd62e8012 100644 --- a/.github/workflows/get-version.yml +++ b/.github/workflows/get-version.yml @@ -9,6 +9,7 @@ jobs: runs-on: ubuntu-latest outputs: semVer: ${{ steps.gitversion.outputs.semVer }} + majorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }} steps: - uses: actions/checkout@v2 with: @@ -30,7 +31,7 @@ jobs: env: SEMVER: ${{ needs.calculate-version.outputs.semVer }} MAJOR: ${{ needs.calculate-version.outputs.Major }} - MMP: ${{ needs.calculate-version.outputs.MajorMinorPatch }} + MMP: ${{ needs.calculate-version.outputs.majorMinorPatch }} outputs: SEMVER: ${{ steps.calc-semver.outputs.semver }} steps: From 3d4cf852216087094e7f16b7caa9a67cdf49cd30 Mon Sep 17 00:00:00 2001 From: Jen Duong Date: Wed, 30 Jul 2025 15:23:58 +0100 Subject: [PATCH 3/6] output to SEMVER and echo --- .github/workflows/get-version.yml | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/.github/workflows/get-version.yml b/.github/workflows/get-version.yml index 6bd62e8012..5ee46c9c3f 100644 --- a/.github/workflows/get-version.yml +++ b/.github/workflows/get-version.yml @@ -8,8 +8,7 @@ jobs: calculate-version: runs-on: ubuntu-latest outputs: - semVer: ${{ steps.gitversion.outputs.semVer }} - majorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }} + SEMVER: ${{ steps.gitversion.outputs.majorMinorPatch }} steps: - uses: actions/checkout@v2 with: @@ -25,21 +24,9 @@ jobs: id: gitversion uses: gittools/actions/gitversion/execute@v0.9.7 - assign-semver: + print-semver: runs-on: ubuntu-latest needs: [calculate-version] - env: - SEMVER: ${{ needs.calculate-version.outputs.semVer }} - MAJOR: ${{ needs.calculate-version.outputs.Major }} - MMP: ${{ needs.calculate-version.outputs.majorMinorPatch }} - outputs: - SEMVER: ${{ steps.calc-semver.outputs.semver }} + env: ${{ steps.calc-semver.outputs.SEMVER }} steps: - - run: echo $MMP - run: echo $SEMVER - - name: Add 3 to calculated semver - run: | - echo SEMVER="$((3 + MAJOR))${SEMVER:1}" >> $GITHUB_ENV - - name: Set semver to output - id: calc-semver - run: echo "::set-output name=semver::$(echo $SEMVER)" From f2c5957382b7f4cec0dcd58d3fac3907e35f08d1 Mon Sep 17 00:00:00 2001 From: Jen Duong Date: Wed, 30 Jul 2025 15:25:55 +0100 Subject: [PATCH 4/6] fix reference to output --- .github/workflows/get-version.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/get-version.yml b/.github/workflows/get-version.yml index 5ee46c9c3f..ad2b4a19a1 100644 --- a/.github/workflows/get-version.yml +++ b/.github/workflows/get-version.yml @@ -27,6 +27,6 @@ jobs: print-semver: runs-on: ubuntu-latest needs: [calculate-version] - env: ${{ steps.calc-semver.outputs.SEMVER }} + env: ${{ needs.calculate-version.outputs.SEMVER }} steps: - run: echo $SEMVER From ecba39192c79143cc7ad63f67336d99cd4017c49 Mon Sep 17 00:00:00 2001 From: Jen Duong Date: Wed, 30 Jul 2025 15:30:04 +0100 Subject: [PATCH 5/6] set env var correctly --- .github/workflows/get-version.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/get-version.yml b/.github/workflows/get-version.yml index ad2b4a19a1..6b565ce64b 100644 --- a/.github/workflows/get-version.yml +++ b/.github/workflows/get-version.yml @@ -27,6 +27,7 @@ jobs: print-semver: runs-on: ubuntu-latest needs: [calculate-version] - env: ${{ needs.calculate-version.outputs.SEMVER }} + env: + SEMVER: ${{ needs.calculate-version.outputs.SEMVER }} steps: - run: echo $SEMVER From aba9293289b00cee5e913248526553246cd45463 Mon Sep 17 00:00:00 2001 From: Jen Duong Date: Wed, 30 Jul 2025 15:38:27 +0100 Subject: [PATCH 6/6] feature: bump minor version --- .github/workflows/get-version.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/get-version.yml b/.github/workflows/get-version.yml index 6b565ce64b..7863e0b5e8 100644 --- a/.github/workflows/get-version.yml +++ b/.github/workflows/get-version.yml @@ -31,3 +31,4 @@ jobs: SEMVER: ${{ needs.calculate-version.outputs.SEMVER }} steps: - run: echo $SEMVER + - run: echo ""