From c9e5350c7f380ee25789b72409a8e8abaf2c3208 Mon Sep 17 00:00:00 2001 From: Kirill Plis Date: Wed, 8 Oct 2025 08:43:10 +0200 Subject: [PATCH 1/5] feat: setup GHA to move major version tag --- .github/workflows/update-major-tag.yml | 37 ++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/update-major-tag.yml diff --git a/.github/workflows/update-major-tag.yml b/.github/workflows/update-major-tag.yml new file mode 100644 index 0000000..6d73dcd --- /dev/null +++ b/.github/workflows/update-major-tag.yml @@ -0,0 +1,37 @@ +name: Update Major Version Tag + +on: + release: + types: [created] + +jobs: + update-major-tag: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Extract major version + id: version + run: | + TAG_NAME="${{ github.event.release.tag_name }}" + # Extract major version (e.g., v8.2.7 -> v8) + MAJOR_VERSION=$(echo $TAG_NAME | sed -E 's/^v([0-9]+)\..*/v\1/') + echo "major_version=$MAJOR_VERSION" >> $GITHUB_OUTPUT + echo "full_version=$TAG_NAME" >> $GITHUB_OUTPUT + + - name: Update major version tag + run: | + git config user.name "parcellab-dev-bot" + git config user.email "dev.bot@parcellab.com" + + # Delete existing major version tag if it exists + echo git tag -d ${{ steps.version.outputs.major_version }} || true + echo git push origin :refs/tags/${{ steps.version.outputs.major_version }} || true + + # Create new major version tag pointing to the same commit as the full version + echo git tag ${{ steps.version.outputs.major_version }} ${{ github.event.release.tag_name }} + echo git push origin ${{ steps.version.outputs.major_version }} + \ No newline at end of file From 201272cefbf62e3a97211d0201d6692bde89ca4b Mon Sep 17 00:00:00 2001 From: Kirill Plis Date: Wed, 8 Oct 2025 11:34:03 +0200 Subject: [PATCH 2/5] move linters to PR workflow, move tag update workflow to release --- .github/workflows/ci.github-workflows.yaml | 42 ++++++++++++++-------- .github/workflows/ci.pr.yaml | 13 +++++++ .github/workflows/update-major-tag.yml | 37 ------------------- 3 files changed, 40 insertions(+), 52 deletions(-) delete mode 100644 .github/workflows/update-major-tag.yml diff --git a/.github/workflows/ci.github-workflows.yaml b/.github/workflows/ci.github-workflows.yaml index 9bd8804..e19261f 100644 --- a/.github/workflows/ci.github-workflows.yaml +++ b/.github/workflows/ci.github-workflows.yaml @@ -10,24 +10,36 @@ on: - ".github/workflows/*.yaml" workflow_dispatch: jobs: - actionlint: + update-major-tag: runs-on: ubuntu-latest steps: - - name: Checkout current git repository - uses: actions/checkout@v3 - - name: Set up go environment - uses: actions/setup-go@v3 - - name: Install actionlint - run: go install github.com/rhysd/actionlint/cmd/actionlint@v1.6.23 - - name: Run actionlint - run: /home/runner/go/bin/actionlint - yamllint: - uses: parcelLab/ci/.github/workflows/yaml.yaml@main + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Extract major version + id: version + run: | + # Get the latest tag created by the release job + TAG_NAME=$(git describe --tags --abbrev=0) + echo "Retrieved tag: $TAG_NAME" + # Extract major version (e.g., v8.2.7 -> v8) + MAJOR_VERSION=$(echo $TAG_NAME | sed -E 's/^v([0-9]+)\..*/v\1/') + echo "major_version=$MAJOR_VERSION" >> $GITHUB_OUTPUT + echo "full_version=$TAG_NAME" >> $GITHUB_OUTPUT + - name: Update major version tag + run: | + git config user.name "parcellab-dev-bot" + git config user.email "dev.bot@parcellab.com" + + # Delete existing major version tag if it exists + git tag -d ${{ steps.version.outputs.major_version }} || true + git push -d origin ${{ steps.version.outputs.major_version }} || true + + # Create new major version tag pointing to the same commit as the full version + git tag ${{ steps.version.outputs.major_version }} + git push origin tag ${{ steps.version.outputs.major_version }} release: - if: github.ref == 'refs/heads/main' - needs: - - actionlint - - yamllint uses: parcelLab/ci/.github/workflows/release.yaml@main secrets: repoAccessToken: ${{ secrets.REPO_ACCESS_TOKEN_OPEN_SOURCE }} diff --git a/.github/workflows/ci.pr.yaml b/.github/workflows/ci.pr.yaml index 1aec4d2..4f5701b 100644 --- a/.github/workflows/ci.pr.yaml +++ b/.github/workflows/ci.pr.yaml @@ -12,3 +12,16 @@ jobs: uses: parcelLab/ci/.github/workflows/pr.yaml@main secrets: repoAccessToken: ${{ secrets.GITHUB_TOKEN }} + actionlint: + runs-on: ubuntu-latest + steps: + - name: Checkout current git repository + uses: actions/checkout@v3 + - name: Set up go environment + uses: actions/setup-go@v3 + - name: Install actionlint + run: go install github.com/rhysd/actionlint/cmd/actionlint@v1.6.23 + - name: Run actionlint + run: /home/runner/go/bin/actionlint + yamllint: + uses: parcelLab/ci/.github/workflows/yaml.yaml@main \ No newline at end of file diff --git a/.github/workflows/update-major-tag.yml b/.github/workflows/update-major-tag.yml deleted file mode 100644 index 6d73dcd..0000000 --- a/.github/workflows/update-major-tag.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Update Major Version Tag - -on: - release: - types: [created] - -jobs: - update-major-tag: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Extract major version - id: version - run: | - TAG_NAME="${{ github.event.release.tag_name }}" - # Extract major version (e.g., v8.2.7 -> v8) - MAJOR_VERSION=$(echo $TAG_NAME | sed -E 's/^v([0-9]+)\..*/v\1/') - echo "major_version=$MAJOR_VERSION" >> $GITHUB_OUTPUT - echo "full_version=$TAG_NAME" >> $GITHUB_OUTPUT - - - name: Update major version tag - run: | - git config user.name "parcellab-dev-bot" - git config user.email "dev.bot@parcellab.com" - - # Delete existing major version tag if it exists - echo git tag -d ${{ steps.version.outputs.major_version }} || true - echo git push origin :refs/tags/${{ steps.version.outputs.major_version }} || true - - # Create new major version tag pointing to the same commit as the full version - echo git tag ${{ steps.version.outputs.major_version }} ${{ github.event.release.tag_name }} - echo git push origin ${{ steps.version.outputs.major_version }} - \ No newline at end of file From a7ac4811efb92587ba98eeadb625eeedaec9b98d Mon Sep 17 00:00:00 2001 From: Kirill Plis Date: Wed, 8 Oct 2025 11:34:27 +0200 Subject: [PATCH 3/5] rename --- .github/workflows/{ci.github-workflows.yaml => ci.release.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{ci.github-workflows.yaml => ci.release.yaml} (100%) diff --git a/.github/workflows/ci.github-workflows.yaml b/.github/workflows/ci.release.yaml similarity index 100% rename from .github/workflows/ci.github-workflows.yaml rename to .github/workflows/ci.release.yaml From f9ebb907f044b0d1f011139940a816ff0db9b2bb Mon Sep 17 00:00:00 2001 From: Kirill Plis Date: Wed, 8 Oct 2025 11:54:42 +0200 Subject: [PATCH 4/5] prettier --- .github/workflows/ci.pr.yaml | 2 +- .github/workflows/ci.release.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.pr.yaml b/.github/workflows/ci.pr.yaml index 4f5701b..3a4a899 100644 --- a/.github/workflows/ci.pr.yaml +++ b/.github/workflows/ci.pr.yaml @@ -24,4 +24,4 @@ jobs: - name: Run actionlint run: /home/runner/go/bin/actionlint yamllint: - uses: parcelLab/ci/.github/workflows/yaml.yaml@main \ No newline at end of file + uses: parcelLab/ci/.github/workflows/yaml.yaml@main diff --git a/.github/workflows/ci.release.yaml b/.github/workflows/ci.release.yaml index e19261f..ddc5651 100644 --- a/.github/workflows/ci.release.yaml +++ b/.github/workflows/ci.release.yaml @@ -28,14 +28,14 @@ jobs: echo "major_version=$MAJOR_VERSION" >> $GITHUB_OUTPUT echo "full_version=$TAG_NAME" >> $GITHUB_OUTPUT - name: Update major version tag - run: | + run: | git config user.name "parcellab-dev-bot" git config user.email "dev.bot@parcellab.com" # Delete existing major version tag if it exists git tag -d ${{ steps.version.outputs.major_version }} || true git push -d origin ${{ steps.version.outputs.major_version }} || true - + # Create new major version tag pointing to the same commit as the full version git tag ${{ steps.version.outputs.major_version }} git push origin tag ${{ steps.version.outputs.major_version }} From d5b85228abdf44b2940958214fd4bbeb9e68fc4f Mon Sep 17 00:00:00 2001 From: Kirill Plis Date: Wed, 8 Oct 2025 12:49:14 +0200 Subject: [PATCH 5/5] linter --- .github/workflows/ci.release.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.release.yaml b/.github/workflows/ci.release.yaml index ddc5651..bf40b4e 100644 --- a/.github/workflows/ci.release.yaml +++ b/.github/workflows/ci.release.yaml @@ -21,24 +21,24 @@ jobs: id: version run: | # Get the latest tag created by the release job - TAG_NAME=$(git describe --tags --abbrev=0) + TAG_NAME="$(git describe --tags --abbrev=0)" echo "Retrieved tag: $TAG_NAME" # Extract major version (e.g., v8.2.7 -> v8) - MAJOR_VERSION=$(echo $TAG_NAME | sed -E 's/^v([0-9]+)\..*/v\1/') - echo "major_version=$MAJOR_VERSION" >> $GITHUB_OUTPUT - echo "full_version=$TAG_NAME" >> $GITHUB_OUTPUT + MAJOR_VERSION="$(echo "$TAG_NAME" | sed -E 's/^v([0-9]+)\..*/v\1/')" + echo "major_version=$MAJOR_VERSION" >> "$GITHUB_OUTPUT" + echo "full_version=$TAG_NAME" >> "$GITHUB_OUTPUT" - name: Update major version tag run: | git config user.name "parcellab-dev-bot" git config user.email "dev.bot@parcellab.com" # Delete existing major version tag if it exists - git tag -d ${{ steps.version.outputs.major_version }} || true - git push -d origin ${{ steps.version.outputs.major_version }} || true + git tag -d "${{ steps.version.outputs.major_version }}" || true + git push -d origin "${{ steps.version.outputs.major_version }}" || true # Create new major version tag pointing to the same commit as the full version - git tag ${{ steps.version.outputs.major_version }} - git push origin tag ${{ steps.version.outputs.major_version }} + git tag "${{ steps.version.outputs.major_version }}" + git push origin tag "${{ steps.version.outputs.major_version }}" release: uses: parcelLab/ci/.github/workflows/release.yaml@main secrets: