Release & Publish to NPM & GitHub #1
This file contains hidden or 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 & Publish to NPM & GitHub | |
on: | |
workflow_dispatch: | |
inputs: | |
increment: | |
description: 'Increment type: major, minor, patch, pre...' | |
required: true | |
type: choice | |
options: | |
- patch | |
- minor | |
- major | |
- prepatch | |
- preminor | |
- premajor | |
default: patch | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4.2.2 | |
with: | |
fetch-depth: 0 | |
- name: Setup | |
uses: ./.github/actions/setup | |
- name: Import GPG key | |
id: import-gpg | |
uses: crazy-max/ghaction-import-gpg@v6.3.0 | |
with: | |
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
passphrase: ${{ secrets.GPG_PASSPHRASE }} | |
git_user_signingkey: true | |
git_commit_gpgsign: true | |
- run: pnpm run release --increment ${{github.event.inputs.increment}} --ci | |
env: | |
# For release-it | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_CONFIG_PROVENANCE: true | |
# For lerna-changelog | |
IGNORE_PEER_DEPENDENCIES: release-it | |
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }} | |
permissions: | |
contents: write | |
id-token: write |