Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: adjust release workflow conditions #2139

Merged
merged 2 commits into from
Oct 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading