From b958d94506a8178c4c8b3000c19ee9c436581f06 Mon Sep 17 00:00:00 2001 From: Antonis Stamatiou Date: Fri, 10 Mar 2023 17:02:08 +0200 Subject: [PATCH] add proper conditions to release pipelines (#2602) --- .github/workflows/release.yaml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ab791869..afcf4a46 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -5,6 +5,9 @@ on: # only for release and release candidates # release-XX.YY.ZZ # release-XX.YY.ZZ-rc-something + tags: + - "v[0-9]+.[0-9]+.[0-9]+" + - "v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+" branches: - release-[0-9]+.[0-9]+ - release-[0-9]+.[0-9]+.[0-9]+ @@ -21,7 +24,10 @@ env: jobs: begin-notification: runs-on: ubuntu-22.04 + if: ${{ startsWith(github.ref, 'refs/tags/v') }} steps: + - name: release/checkout-repo + uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 - name: release/notify-channel run: | jq --null-input \ @@ -33,8 +39,6 @@ jobs: build-linux: runs-on: ubuntu-latest-4-cores - needs: - - begin-notification steps: - name: release/checkout-repo uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 @@ -69,8 +73,6 @@ jobs: build-msi-installer: runs-on: windows-2022 - needs: - - begin-notification steps: - name: release/checkout-repo uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 @@ -118,8 +120,6 @@ jobs: build-mac-installer: runs-on: macos-12 - needs: - - mac-app-store-preflight steps: - name: release/checkout-repo uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 @@ -168,8 +168,6 @@ jobs: CSC_FOR_PULL_REQUEST: true CSC_KEY_PASSWORD: ${{ secrets.MM_DESKTOP_MAC_APP_STORE_CSC_KEY_PASSWORD}} CSC_LINK: ${{ secrets.MM_DESKTOP_MAC_APP_STORE_CSC_LINK }} - needs: - - begin-notification steps: - name: release/checkout-repo uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 @@ -192,11 +190,13 @@ jobs: - name: release/package run: npm run package:mas - name: release/publish + if: ${{ startsWith(github.ref, 'refs/tags/v') }} run: fastlane publish_test path:"$(find . -name \*.pkg -print -quit)" upload-to-s3: runs-on: ubuntu-22.04 needs: + - mac-app-store-preflight - build-mac-installer - build-msi-installer - build-linux @@ -218,6 +218,7 @@ jobs: github-release: runs-on: ubuntu-22.04 + if: ${{ startsWith(github.ref, 'refs/tags/v') }} needs: - upload-to-s3 steps: @@ -245,9 +246,12 @@ jobs: end-notification: runs-on: ubuntu-22.04 + if: ${{ startsWith(github.ref, 'refs/tags/v') }} needs: - github-release steps: + - name: release/checkout-repo + uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 - name: release/notify-channel run: | jq --null-input \