Skip to content

Release

Release #37

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
channel:
description: 'NPM Release channel'
type: choice
required: false
options:
- preview
- latest
dry-run:
description: Should only preview operations instead of actually executing them
type: boolean
required: false
default: true
publish-only:
description: Should run only publish command
type: boolean
required: false
default: false
skip-publish:
description: Should run only version and changelog and skip publishing
type: boolean
required: false
default: false
github-release:
description: Should create Github release (doing so will require pushing changes)
type: boolean
required: false
default: true
env:
TERM: xterm-256color
FORCE_COLOR: 'true'
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-tags: 'true'
fetch-depth: '0'
- name: Enable Corepack
run: corepack enable
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org/'
cache: 'yarn'
cache-dependency-path: 'yarn.lock'
- name: Install dependencies
run: yarn install --immutable
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
run: npm audit signatures
- name: Lint all packages
run: yarn lint
- name: Test all packages
run: yarn test
- name: Build all packages
run: yarn build
- name: Setup Git user
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com"
- name: Release packages on '${{ inputs.channel }}' channel ${{ inputs.dry-run && '(dry-run)' || ''}}
run: yarn release -c ${{ inputs.channel }} --verbose ${{ inputs.publish-only && '--publishOnly' || '' }} ${{ inputs.skip-publish && '--skipPublish' || '' }} ${{ inputs.github-release && '--githubRelease' || '' }} ${{ inputs.dry-run && '--dryRun' || '' }}
env:
RELEASE_ENABLED: ${{ vars.RELEASE_ENABLED }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true