Skip to content

Commit

Permalink
chore: adjust release workflow conditions (#2139)
Browse files Browse the repository at this point in the history
- adjust job `if` conditions
- change `release` user to [Stream CI
Bot](https://github.com/stream-ci-bot)
  • Loading branch information
arnautov-anton committed Oct 25, 2023
1 parent 160a57a commit cb6ef2a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -43,15 +43,17 @@ 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' || '' }}
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:
Expand Down

0 comments on commit cb6ef2a

Please sign in to comment.