Skip to content

Release

Release #140

Workflow file for this run

name: Release
on:
workflow_dispatch:
concurrency: "${{ github.workflow }}-${{ github.ref }}"
jobs:
release:
name: Changesets Release
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
id-token: write # Required to perform `npm publish --provenance`
environment: production
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js 20.x
uses: actions/setup-node@v4
with:
cache: 'yarn'
node-version: 20.12.2
- name: Install Dependencies
run: yarn install --immutable
- name: Build
run: yarn build
- name: Create dummy npmrc # Prevent creation of '.npmrc' by 'changesets-gitlab' with the 'NPM_TOKEN'
run: touch ".npmrc"
- name: Set token in .yarnrc.yml
run: |
yarn config set 'npmScopes["openapi-qraft"]' --home --json '{"npmAlwaysAuth":true,"npmAuthToken":"${NPM_TOKEN}"}'
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create Version Packages Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: yarn exec .changeset/publish.sh --create-git-tags
version: exit 1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
WITH_PROVENANCE: true