From b403fdfc529df89696c3179e6ff7837937975c58 Mon Sep 17 00:00:00 2001 From: Anton Arnautov Date: Thu, 19 Oct 2023 15:55:30 +0200 Subject: [PATCH 1/2] Adjust job conditions --- .github/workflows/release.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e3751a350..be91e46da 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,7 @@ on: default: false type: boolean dry_run: - description: Run package release in "dry run" mode (does not publish) + description: Run package release in "dry run" mode (does not publish either) default: false type: boolean docs_env: @@ -24,7 +24,7 @@ jobs: name: Release from "${{ github.ref_name }}" branch runs-on: ubuntu-latest # GH does not allow to limit branches in the workflow_dispatch settings so this here is a safety measure - if: ${{ inputs.docs_only == 'false' || github.ref_name == 'master' || github.ref_name == 'rc' || github.ref_name == 'release-v9' }} + if: ${{ !inputs.docs_only && (github.ref_name == 'master' || github.ref_name == 'rc' || github.ref_name == 'release-v9') }} env: NODE_OPTIONS: --max_old_space_size=4096 steps: @@ -51,7 +51,8 @@ jobs: docs_release: name: Publish documentation from "${{ github.ref_name }}" branch to ${{ inputs.docs_env }} runs-on: ubuntu-latest - if: ${{ inputs.dry_run == 'false' }} + # skip during dry runs, release to production only from master, release to staging from anywhere + if: ${{ !inputs.dry_run && ((inputs.docs_env == 'production' && github.ref_name == 'master') || (github.ref_name != 'master' && inputs.docs_env == 'staging')) }} outputs: target-version: $${{ steps.target-version.outputs }} steps: From d25bf71356df1173f97bf04d746de836b89693c6 Mon Sep 17 00:00:00 2001 From: Anton Arnautov Date: Thu, 19 Oct 2023 17:01:39 +0200 Subject: [PATCH 2/2] Use Stream CI Bot for the release processes --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index be91e46da..685940c5a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -43,7 +43,8 @@ jobs: - name: Release env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # https://github.com/stream-ci-bot + GH_TOKEN: ${{ secrets.DOCUSAURUS_GH_TOKEN }} run: > yarn semantic-release ${{ inputs.dry_run && '--dry-run' || '' }}