Packages Release #230
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: Packages Release | |
on: | |
workflow_dispatch: | |
inputs: | |
type: | |
description: 'Release type: "stable" or "next". Versions are determined automatically via conventional commits.' | |
type: choice | |
required: false | |
options: | |
- stable | |
- next | |
default: 'stable' | |
concurrency: | |
group: ${{github.workflow}}-${{github.head_ref}} | |
cancel-in-progress: false | |
env: | |
CI: true | |
# https://github.blog/2023-04-19-introducing-npm-package-provenance | |
NPM_CONFIG_PROVENANCE: true | |
jobs: | |
stable-version: | |
# https://docs.npmjs.com/generating-provenance-statements#publishing-packages-with-provenance-via-github-actions | |
permissions: | |
id-token: write | |
timeout-minutes: 20 | |
runs-on: ubuntu-latest | |
if: ${{ github.event.inputs.type == 'stable' }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.GH_TOKEN_WORKFLOW_PUBLISH }} | |
- uses: ./.github/actions/node | |
with: | |
working-directory: ${{ env.WORKING_DIRECTORY }} | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- run: npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN | |
shell: bash | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Install | |
run: | | |
pnpm install --ignore-scripts | |
pnpm run patch | |
- run: pnpm build:libs | |
- name: Publish packages & Create Github Releases | |
run: | | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git config --global user.name "github-actions[bot]" | |
pnpm run ci:publish:packages | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN_WORKFLOW_PUBLISH }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
next-version: | |
# https://docs.npmjs.com/generating-provenance-statements#publishing-packages-with-provenance-via-github-actions | |
permissions: | |
id-token: write | |
timeout-minutes: 10 | |
runs-on: ubuntu-latest | |
if: ${{ github.event.inputs.type == 'next' }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.GH_TOKEN_WORKFLOW_PUBLISH }} | |
- uses: ./.github/actions/node | |
with: | |
working-directory: ${{ env.WORKING_DIRECTORY }} | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- run: npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN | |
shell: bash | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- run: pnpm install --ignore-scripts | |
- run: pnpm build:libs | |
- name: Publish packages & Create Github Releases | |
run: | | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git config --global user.name "github-actions[bot]" | |
pnpm run ci:publish:packages-next | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN_WORKFLOW_PUBLISH }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |