Release #4
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: | |
type: | |
type: choice | |
description: Choose release type | |
options: | |
- auto | |
- patch | |
- minor | |
- major | |
default: auto | |
beta: | |
type: boolean | |
description: Prerelease | |
default: false | |
npm: | |
type: boolean | |
description: NPM release | |
default: true | |
dry: | |
type: boolean | |
description: Dry release | |
default: false | |
jobs: | |
releaseIt: | |
runs-on: ubuntu-latest | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install pnpm | |
uses: pnpm/[email protected] | |
with: | |
version: 8 | |
- name: Set node version to 16.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
registry-url: https://registry.npmjs.org/ | |
cache: "pnpm" | |
- name: Npm credentials | |
run: npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN | |
- name: Install deps | |
run: pnpm install | |
env: | |
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1" | |
- name: Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
TYPE_ARG: ${{ fromJSON('{"auto":"", "patch":"--patch", "minor":"--minor", "major":"--major"}')[github.event.inputs.type] }} | |
BETA_ARG: ${{ github.event.inputs.beta == 'true' && '--preRelease=beta' || '' }} | |
DRY_ARG: ${{ github.event.inputs.dry == 'true' && '--dry-run' || '' }} | |
run: npm run release -- --ci --verbose $TYPE_ARG $BETA_ARG $DRY_ARG | |
- name: npm-release | |
if: ${{ github.event.inputs.dry == 'false' && github.event.inputs.npm == 'true' }} | |
run: npm publish |