From 0e2706a5c06fce25ec5de7c7c75b281b90351183 Mon Sep 17 00:00:00 2001 From: yougotwill Date: Wed, 19 Feb 2025 16:33:54 +1100 Subject: [PATCH] feat: added gh actions support for publishing alpha releases branch name example release/1.14.6-alpha.0 --- .github/workflows/build-binaries.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-binaries.yml b/.github/workflows/build-binaries.yml index 43bbfd336..48daa8571 100644 --- a/.github/workflows/build-binaries.yml +++ b/.github/workflows/build-binaries.yml @@ -24,6 +24,7 @@ concurrency: env: # we want to publish on "push to master" only. When we don't want to publish, we want to upload artefacts SHOULD_PUBLISH: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} + SHOULD_PUBLISH_ALPHA: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release') && contains(github.ref, '-alpha.') }} jobs: build_linux: @@ -61,20 +62,20 @@ jobs: - name: Build but do not publish ${{ matrix.pkg_to_build }} # we want this to run always, except on "push" to "master" - if: ${{ env.SHOULD_PUBLISH == 'false' }} + if: ${{ env.SHOULD_PUBLISH == 'false' && env.SHOULD_PUBLISH_ALPHA == 'false' }} run: | sed -i 's/"target": \["deb"\]/"target": "${{ matrix.pkg_to_build }}"/g' package.json && yarn build-release - name: Upload artefacts ${{ matrix.pkg_to_build }} # we want this to run always, except on "push" to "master" - if: ${{ env.SHOULD_PUBLISH == 'false' }} + if: ${{ env.SHOULD_PUBLISH == 'false' && env.SHOULD_PUBLISH_ALPHA == 'false' }} uses: ./actions/upload_prod_artefacts with: upload_prefix: ${{ runner.os }}-${{ runner.arch }}-${{ matrix.pkg_to_build }} - name: Build & publish ${{ matrix.pkg_to_build }} # we want this to run only when on "push" to "master" - if: ${{ env.SHOULD_PUBLISH == 'true' }} + if: ${{ env.SHOULD_PUBLISH == 'true' || env.SHOULD_PUBLISH_ALPHA == 'true' }} run: | sed -i 's/"target": \["deb"\]/"target": "${{ matrix.pkg_to_build }}"/g' package.json && yarn build-release-publish @@ -99,19 +100,19 @@ jobs: - name: Build but do not publish # we want this to run always, except on "push" to "master" - if: ${{ env.SHOULD_PUBLISH == 'false' }} + if: ${{ env.SHOULD_PUBLISH == 'false' && env.SHOULD_PUBLISH_ALPHA == 'false' }} run: yarn build-release - name: Upload artefacts # we want this to run always, except on "push" to "master" - if: ${{ env.SHOULD_PUBLISH == 'false' }} + if: ${{ env.SHOULD_PUBLISH == 'false' && env.SHOULD_PUBLISH_ALPHA == 'false' }} uses: ./actions/upload_prod_artefacts with: upload_prefix: ${{ runner.os }}-${{ runner.arch }} - name: Build & publish # we want this to run only when on "push" to "master" - if: ${{ env.SHOULD_PUBLISH == 'true' }} + if: ${{ env.SHOULD_PUBLISH == 'true' || env.SHOULD_PUBLISH_ALPHA == 'true' }} run: yarn build-release-publish # No other args needed for windows publish # We want a mac arm64 build, and according to this https://github.com/actions/runner-images#available-images macos-14 is always arm64 @@ -142,21 +143,21 @@ jobs: - name: Build but do not publish # we want this to run always, except on "push" to "master" - if: ${{ env.SHOULD_PUBLISH == 'false' }} + if: ${{ env.SHOULD_PUBLISH == 'false' && env.SHOULD_PUBLISH_ALPHA == 'false' }} run: | source ./build/setup-mac-certificate.sh yarn build-release --config.mac.bundleVersion=${{ github.ref }} - name: Upload artefacts # we want this to run always, except on "push" to "master" - if: ${{ env.SHOULD_PUBLISH == 'false' }} + if: ${{ env.SHOULD_PUBLISH == 'false' && env.SHOULD_PUBLISH_ALPHA == 'false' }} uses: ./actions/upload_prod_artefacts with: upload_prefix: ${{ runner.os }}-${{ runner.arch }} - name: Build & publish # we want this to run only when on "push" to "master" - if: ${{ env.SHOULD_PUBLISH == 'true' }} + if: ${{ env.SHOULD_PUBLISH == 'true' || env.SHOULD_PUBLISH_ALPHA == 'true' }} run: | source ./build/setup-mac-certificate.sh yarn build-release-publish --config.mac.bundleVersion=${{ github.ref }}