diff --git a/.github/workflows/community_release.yml b/.github/workflows/community_release.yml index 03c6a6abeb..ce07c44d91 100644 --- a/.github/workflows/community_release.yml +++ b/.github/workflows/community_release.yml @@ -6,6 +6,11 @@ name: Community Release - 'v[0-9]+.[0-9]+.[0-9]+' - v*-rc* +concurrency: + group: community-release + cancel-in-progress: false + queue: max + permissions: contents: write @@ -69,6 +74,20 @@ jobs: steps: - name: Checkout source uses: actions/checkout@v7 + with: + fetch-depth: 0 + + - name: Check if latest version + id: is_latest + env: + RELEASE_TAG: ${{ github.ref_name }} + run: | + HIGHEST_TAG=$(git tag -l --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -n 1 || true) + if [ "$RELEASE_TAG" = "$HIGHEST_TAG" ]; then + echo "is_latest=true" >> "$GITHUB_OUTPUT" + else + echo "is_latest=false" >> "$GITHUB_OUTPUT" + fi - name: Setup qemu id: qemu @@ -100,7 +119,7 @@ jobs: tags: | type=raw,value=${{ github.ref_name }} flavor: | - latest=true + latest=${{ steps.is_latest.outputs.is_latest }} - name: Server build uses: docker/build-push-action@v7 @@ -156,7 +175,7 @@ jobs: tags: | type=raw,value=${{ github.ref_name }} flavor: | - latest=true + latest=${{ steps.is_latest.outputs.is_latest }} - name: Runner build uses: docker/build-push-action@v7 diff --git a/.github/workflows/pro_selfhosted_beta.yml b/.github/workflows/pro_selfhosted_beta.yml index d92c04015e..e7ca057446 100644 --- a/.github/workflows/pro_selfhosted_beta.yml +++ b/.github/workflows/pro_selfhosted_beta.yml @@ -150,6 +150,8 @@ jobs: maintainer=Semaphore UI tags: | type=raw,value=${{ github.ref_name }} + flavor: | + latest=false - name: Server build uses: docker/build-push-action@v7 @@ -230,6 +232,8 @@ jobs: maintainer=Semaphore UI tags: | type=raw,value=${{ github.ref_name }} + flavor: | + latest=false - name: Runner build uses: docker/build-push-action@v7 diff --git a/.github/workflows/pro_selfhosted_release.yml b/.github/workflows/pro_selfhosted_release.yml index 2e01052ea3..3f6699565e 100644 --- a/.github/workflows/pro_selfhosted_release.yml +++ b/.github/workflows/pro_selfhosted_release.yml @@ -5,6 +5,11 @@ name: Pro Self-Hosted Release tags: - 'v[0-9]+.[0-9]+.[0-9]+' +concurrency: + group: pro-selfhosted-release + cancel-in-progress: false + queue: max + permissions: contents: write @@ -86,6 +91,18 @@ jobs: with: fetch-depth: 0 + - name: Check if latest version + id: is_latest + env: + RELEASE_TAG: ${{ github.ref_name }} + run: | + HIGHEST_TAG=$(git tag -l --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -n 1 || true) + if [ "$RELEASE_TAG" = "$HIGHEST_TAG" ]; then + echo "is_latest=true" >> "$GITHUB_OUTPUT" + else + echo "is_latest=false" >> "$GITHUB_OUTPUT" + fi + - name: Determine PRO branch uses: ./.github/actions/determine-pro-branch with: @@ -133,7 +150,7 @@ jobs: tags: | type=raw,value=${{ github.ref_name }} flavor: | - latest=true + latest=${{ steps.is_latest.outputs.is_latest }} - name: Server build uses: docker/build-push-action@v7 @@ -215,7 +232,7 @@ jobs: tags: | type=raw,value=${{ github.ref_name }} flavor: | - latest=true + latest=${{ steps.is_latest.outputs.is_latest }} - name: Runner build uses: docker/build-push-action@v7