feat: added gh actions support for publishing alpha releases

branch name example release/1.14.6-alpha.0
pull/3281/head
yougotwill 2 months ago
parent 2e6ff217a2
commit 0e2706a5c0

@ -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 }}

Loading…
Cancel
Save