From 56a5ce3e1d02e40407516901ab6f247ac4b43636 Mon Sep 17 00:00:00 2001 From: Zhiming Ma Date: Sun, 13 Oct 2024 23:05:54 +0800 Subject: [PATCH 1/2] ci: explicitly set latest tag when creating release. --- .github/workflows/release-intellij.yml | 18 ++++++++++++++---- .github/workflows/release.yml | 16 ++++++++++++++-- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release-intellij.yml b/.github/workflows/release-intellij.yml index 412e9b9b91c..39354d347e5 100644 --- a/.github/workflows/release-intellij.yml +++ b/.github/workflows/release-intellij.yml @@ -55,10 +55,8 @@ jobs: run: pnpm install - name: Determine Publish Channel - env: - VERSION_STRING: run: | - if [[ ${{ github.ref_name }} =~ intellij@[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + if [[ ${{ github.ref_name }} =~ ^intellij@[0-9]+\.[0-9]+\.[0-9]+$ ]]; then echo "PUBLISH_CHANNEL=stable" >> $GITHUB_ENV else echo "PUBLISH_CHANNEL=alpha" >> $GITHUB_ENV @@ -130,11 +128,23 @@ jobs: arguments: signPlugin build-root-directory: clients/intellij + - name: Determine is stable release + run: | + if [[ ${{ github.ref_name }} =~ ^intellij@[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "STABLE_RELEASE=true" >> $GITHUB_ENV + else + echo "STABLE_RELEASE=false" >> $GITHUB_ENV + fi + + - name: Check if stable release + run: echo "Stable Release is ${{ env.STABLE_RELEASE }}" + - name: Create GitHub Release uses: ncipollo/release-action@v1 with: allowUpdates: true - prerelease: true + prerelease: ${{ env.STABLE_RELEASE == 'false' }} + makeLatest: ${{ env.STABLE_RELEASE == 'true' }} tag: ${{ github.ref_name }} removeArtifacts: true artifacts: "clients/intellij/build/distributions/intellij-tabby-signed.zip" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4e024a39b94..bffbe190ad2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -329,11 +329,23 @@ jobs: - name: Display structure of created files run: ls -R dist + - name: Determine is stable release + run: | + if [[ ${{ github.ref_name }} =~ ^v@[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "STABLE_RELEASE=true" >> $GITHUB_ENV + else + echo "STABLE_RELEASE=false" >> $GITHUB_ENV + fi + + - name: Check if stable release + run: echo "Stable Release is ${{ env.STABLE_RELEASE }}" + - uses: ncipollo/release-action@v1 if: github.event_name == 'push' with: - allowUpdates: true - prerelease: true + allowUpdates: true + prerelease: ${{ env.STABLE_RELEASE == 'false' }} + makeLatest: ${{ env.STABLE_RELEASE == 'true' }} artifacts: "dist/tabby_*.zip" tag: ${{ github.ref_name }} removeArtifacts: true From e738ac30b06a8c30c4bab9cf34fb86ca9b449b7d Mon Sep 17 00:00:00 2001 From: Zhiming Ma Date: Sun, 13 Oct 2024 23:08:22 +0800 Subject: [PATCH 2/2] ci: set intellij release makeLatest to false. --- .github/workflows/release-intellij.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-intellij.yml b/.github/workflows/release-intellij.yml index 39354d347e5..754129025a3 100644 --- a/.github/workflows/release-intellij.yml +++ b/.github/workflows/release-intellij.yml @@ -144,7 +144,7 @@ jobs: with: allowUpdates: true prerelease: ${{ env.STABLE_RELEASE == 'false' }} - makeLatest: ${{ env.STABLE_RELEASE == 'true' }} + makeLatest: false tag: ${{ github.ref_name }} removeArtifacts: true artifacts: "clients/intellij/build/distributions/intellij-tabby-signed.zip"