Release Full #12
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 Full | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| type: choice | |
| description: "Release Version Type" | |
| required: true | |
| default: "patch" | |
| options: | |
| - major | |
| - premajor | |
| - minor | |
| - preminor | |
| - patch | |
| - prepatch | |
| - prerelease | |
| tag: | |
| type: choice | |
| description: "Release Npm Tag" | |
| required: true | |
| default: "latest" | |
| options: | |
| - canary | |
| - nightly | |
| - latest | |
| - beta | |
| - alpha | |
| dry_run: | |
| type: boolean | |
| description: "DryRun release" | |
| required: true | |
| default: false | |
| permissions: | |
| contents: write | |
| # To publish packages with provenance | |
| id-token: write | |
| jobs: | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| environment: npm | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Pnpm | |
| run: | | |
| npm install -g corepack@latest | |
| corepack enable | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: "pnpm" | |
| # Update npm to the latest version to enable OIDC | |
| - name: Update npm | |
| run: | | |
| npm install -g npm@latest | |
| npm --version | |
| - name: Install Dependencies | |
| run: pnpm install | |
| - name: Run Test | |
| run: pnpm run test | |
| - name: Try release to npm | |
| run: pnpm run release | |
| env: | |
| DRY_RUN: ${{ inputs.dry_run }} | |
| TAG: ${{ inputs.tag }} | |
| VERSION: ${{ inputs.version }} |