From f59cbf33bea70499c3a5faf5bbe385d1948ed322 Mon Sep 17 00:00:00 2001 From: Mathieu Hofman Date: Thu, 21 Sep 2023 01:00:53 +0000 Subject: [PATCH] ci: jobs compatibility with release branch (#8369) --- .github/workflows/after-merge.yml | 26 ++++++++++++++------- .github/workflows/ag-solo-xs.yml.DISABLED | 2 +- .github/workflows/deployment-test.yml | 2 +- .github/workflows/docker.yml | 25 +++++++++++++------- .github/workflows/golangci-lint.yml | 2 +- .github/workflows/integration.yml | 2 +- .github/workflows/pre-check-integration.yml | 2 +- 7 files changed, 38 insertions(+), 23 deletions(-) diff --git a/.github/workflows/after-merge.yml b/.github/workflows/after-merge.yml index 31c8ef4d31a..c9a3b86d644 100644 --- a/.github/workflows/after-merge.yml +++ b/.github/workflows/after-merge.yml @@ -6,7 +6,8 @@ on: branches: # $default-branch - master - - release-pismo + - 'release-*' + workflow_dispatch: jobs: build: @@ -54,13 +55,20 @@ jobs: run: npm whoami - name: publish to NPM tag run: | - if [ "${{ github.ref_name }}" = "release-pismo" ]; then - # A pismo dev release. - TAG=pismo-dev - else - # Just a dev release. - TAG=dev - fi + case $GITHUB_REF_NAME in + release-*) + # A pre-release. + TAG=${GITHUB_REF_NAME#release-}-dev + ;; + master) + # A trunk dev release. + TAG=dev + ;; + *) + # Some other dev release. + TAG=other-dev + ;; + esac # without concurrency until https://github.com/Agoric/agoric-sdk/issues/8091 yarn lerna publish --concurrency 1 --conventional-prerelease --canary --exact \ --dist-tag=$TAG --preid=$TAG-$(git rev-parse --short=7 HEAD) \ @@ -102,7 +110,7 @@ jobs: - uses: nwtgck/actions-netlify@v1.1 with: # Production deployment if a push or merged PR. - production-deploy: ${{github.event_name == 'push'}} + production-deploy: ${{ github.event_name == 'push' && github.ref_name == 'master' }} publish-dir: coverage/html # SECURITY: we don't want to hand out the Github token to this action. # github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ag-solo-xs.yml.DISABLED b/.github/workflows/ag-solo-xs.yml.DISABLED index 368d0f724ef..e832dd99453 100644 --- a/.github/workflows/ag-solo-xs.yml.DISABLED +++ b/.github/workflows/ag-solo-xs.yml.DISABLED @@ -8,7 +8,7 @@ on: branches: # $default-branch - master - - release-pismo + - 'release-*' jobs: xs-build: diff --git a/.github/workflows/deployment-test.yml b/.github/workflows/deployment-test.yml index c32253ee49e..5f97ecfa019 100644 --- a/.github/workflows/deployment-test.yml +++ b/.github/workflows/deployment-test.yml @@ -7,7 +7,7 @@ on: push: branches: - master - - release-pismo + - 'release-*' - beta tags: - '@agoric/sdk@*' diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index d5c4cc2aa3e..bdfb8ab54e8 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -5,7 +5,7 @@ on: branches: # $default-branch - master - - release-pismo + - 'release-*' tags: - '@agoric/sdk@*' workflow_dispatch: @@ -139,16 +139,23 @@ jobs: id: docker-tags run: | set -ex - SDK_TAG=$(echo "${{ github.ref_name }}" | sed -ne 's!^@agoric/sdk@!!p') + SDK_TAG=$(echo "$GITHUB_REF_NAME" | sed -ne 's!^@agoric/sdk@!!p') case $SDK_TAG in "") - if [ "${{ github.ref_name }}" = "release-pismo" ]; then - # A pismo dev release. - DOCKER_TAGS=pismo-dev - else - # Just a dev release. - DOCKER_TAGS=dev - fi + case $GITHUB_REF_NAME in + release-*) + # A pre-release. + DOCKER_TAGS=${GITHUB_REF_NAME#release-}-dev + ;; + master) + # A trunk dev release. + DOCKER_TAGS=dev + ;; + *) + # Some other dev release. + DOCKER_TAGS=other-dev + ;; + esac ;; *) # A tagged SDK release. diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 7d1e387affe..993e5bb4f7a 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -6,7 +6,7 @@ on: branches: # $default-branch - master - - release-pismo + - 'release-*' pull_request: merge_group: permissions: diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index b765a136ec4..f46760f19e7 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -5,7 +5,7 @@ on: push: branches: - master - - release-pismo + - 'release-*' - beta pull_request: types: diff --git a/.github/workflows/pre-check-integration.yml b/.github/workflows/pre-check-integration.yml index bb886ab9258..b110d5c033e 100644 --- a/.github/workflows/pre-check-integration.yml +++ b/.github/workflows/pre-check-integration.yml @@ -15,7 +15,7 @@ jobs: contains(github.event.pull_request.labels.*.name, 'force:integration') || ( ( github.event.pull_request.base.ref == 'master' || - github.event.pull_request.base.ref == 'release-pismo' || + startsWith(github.event.pull_request.base.ref, 'release-') || github.event.pull_request.base.ref == 'beta' ) && github.event.pull_request.draft == false &&