release [major] by @KillianH (dry run) #14
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 | |
run-name: "release [${{ inputs.type }}] by @${{ github.actor }}${{ github.event.inputs.dry == 'true' && ' (dry run)' || '' }}" | |
on: | |
workflow_dispatch: | |
inputs: | |
type: | |
type: choice | |
description: Choose release | |
options: | |
- auto | |
- patch | |
- minor | |
- major | |
- alpha | |
- beta | |
default: auto | |
dry: | |
type: boolean | |
description: Dry release | |
default: false | |
jobs: | |
publish: | |
name: Publish release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Enable Corepack | |
run: corepack enable | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'yarn' | |
- run: yarn install --immutable | |
- run: yarn build | |
- name: NPM config | |
run: npm config set //registry.npmjs.org/:_authToken "$NPM_TOKEN" | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Git config | |
run: | | |
git config user.name github-actions[bot] | |
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | |
- name: Release | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
TYPE_ARG: ${{ fromJSON('{"auto":"", "patch":"--patch", "minor":"--minor", "major":"--major", "beta":"--preRelease=beta --npm.tag=next", "alpha":"--preRelease=alpha --npm.tag=next"}')[github.event.inputs.type] }} | |
DRY_ARG: ${{ github.event.inputs.dry == 'true' && '--dry-run' || '' }} | |
run: yarn run release --ci --no-git.requireUpstream --verbose "$TYPE_ARG" "$DRY_ARG" |