Parallel release #446
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
branches: | |
- main | |
pull_request: # Runs on pull requests to any branch | |
jobs: | |
determine-should-release: | |
if: ${{ startsWith(github.head_ref, 'release--') }} | |
name: Determine if this branch should release | |
runs-on: ubuntu-latest | |
outputs: | |
should-release: ${{ steps.determine-should-release.outputs.should-release }} | |
steps: | |
- uses: actions/checkout@v4 | |
- id: determine-should-release | |
uses: ./.github/actions/should_release | |
get-test-infos: | |
needs: determine-should-release | |
# Only run this job if it's a release branch. This job will run instead of run-tests and will automatically publish another commit which will be tested | |
if: ${{ startsWith(github.head_ref, 'release--') && needs.determine-should-release.outputs.should-release }} | |
name: Get test infos | |
runs-on: ubuntu-latest | |
outputs: | |
test-infos: ${{ steps.get-test-infos.outputs.test-infos }} | |
steps: | |
- uses: actions/checkout@v4 | |
- id: get-node-version | |
uses: ./.github/actions/get_node_version | |
- name: Get all test infos | |
id: get-test-infos | |
uses: ./.github/actions/get_test_infos | |
with: | |
node-version: ${{ steps.get-node-version.outputs.node-version }} | |
directories: | | |
./examples | |
./tests | |
get-ref: | |
name: Get ref | |
runs-on: ubuntu-latest | |
outputs: | |
ref: ${{ steps.set-ref.outputs.ref }} | |
steps: | |
- id: set-ref | |
run: echo "ref=${{ github.event.pull_request.head.ref || github.ref }}" >> $GITHUB_OUTPUT | |
- name: Print ref | |
run: echo "The ref is ${{ steps.set-ref.outputs.ref }}" | |
release: | |
name: Deploy release | |
if: ${{ needs.determine-should-release.outputs.should-release == 'true' }} | |
needs: | |
- determine-should-release | |
- get-test-infos | |
uses: ./.github/workflows/release_parallel.yml | |
secrets: | |
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} # All commits must be verified | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |