release #9
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: | |
workflow_dispatch: | |
inputs: | |
version: | |
type: string | |
description: The version to use for the release. | |
default: '' | |
dry-run: | |
type: boolean | |
default: true | |
push: | |
branches: | |
- 'main' | |
jobs: | |
main: | |
if: "${{ github.event_name == 'workflow_dispatch' || !startsWith(github.event.head_commit.message, 'chore: release') }}" | |
runs-on: ubuntu-latest | |
permissions: | |
actions: read | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- run: | | |
git config user.email "[email protected]" | |
git config user.name "release" | |
- run: corepack enable | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: package.json | |
cache: 'pnpm' | |
cache-dependency-path: 'pnpm-lock.yaml' | |
- run: pnpm i | |
- run: pnpm exec nx report | |
- run: pnpm exec nx release --skip-publish --dry-run=${{ env.DRY_RUN }} ${{ env.VERSION }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
DRY_RUN: ${{ github.event_name == 'push' || inputs.dry-run }} | |
VERSION: ${{ github.event_name == 'push' && '' || inputs.version }} |