Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Publish Packages

on:
push:
branches:
- main

jobs:
build-and-publish:
if: startsWith(github.event.head_commit.message, 'chore(release):')
runs-on: ubuntu-latest-large

timeout-minutes: 15

environment: production

# id-token: write lets Lerna 9 exchange a GitHub OIDC token for a short-lived,
# per-package npm token (keyless "trusted publishing"). contents: write is used
# by the release-tag/GitHub-release steps on the latest channel. Each package
# must be registered as a trusted publisher on npmjs.org for this repo +
# publish.yml + `production`, or its publish fails.
permissions:
contents: write
id-token: write

strategy:
matrix:
node-version: [20.x]

steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: '0'
fetch-tags: true

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: ${{ matrix.node-version }}

# For eventual tag pushing and release creation
- name: Setup git credentials
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"

- name: Install Dependencies
run: yarn install --frozen-lockfile

- name: Build
run: NODE_ENV=production yarn build

- name: Publish
# Keyless publish via npm OIDC trusted publishing — no long-lived token.
# Lerna 9 auto-detects GitHub Actions OIDC (id-token: write above),
# exchanges it per-package for a short-lived npm token, and enables
# provenance automatically (public repo + public package).
run: yarn lerna publish from-package --yes --loglevel=verbose --dist-tag latest
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@playwright/test": "^1.32.3",
"concurrently": "^8.0.0",
"husky": "^8.0.3",
"lerna": "^7.3.0",
"lerna": "^9.0.0",
"lint-staged": "^15.0.2",
"node-gyp": "^10.0.0",
"prettier": "^2.3.2",
Expand Down
Loading