Skip to content

build: added trusted publishing #55

build: added trusted publishing

build: added trusted publishing #55

Workflow file for this run

name: Release
env:
USE_LOCKFILE: ${{ secrets.USE_LOCKFILE }}
ENABLE_RELEASE: ${{ secrets.ENABLE_RELEASE }}
on:
push:
branches: [ master, alpha, beta, build ]
repository_dispatch:
types: [ release ]
permissions:
id-token: write
jobs:
release:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ["lts/*"]
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 trusted publishing and npm provenance
steps:
- uses: actions/checkout@v6
- name: Setup
uses: ./.github/actions/composite-setup
with:
USE_LOCKFILE: ${{ secrets.USE_LOCKFILE }}
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Build
uses: ./.github/actions/composite-build
with:
USE_LOCKFILE: ${{ secrets.USE_LOCKFILE }}
- name: Release
if: "env.ENABLE_RELEASE == 'true' && ! contains('refs/heads/build ', github.ref)"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: pnpm semantic-release
- name: Release Dry Run
if: "env.ENABLE_RELEASE != 'true' || contains('refs/heads/build ', github.ref)"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: pnpm semantic-release --dry-run
- run: echo "env.ENABLE_RELEASE is ${{ env.ENABLE_RELEASE == 'true' }} and branch is ${{ github.ref }}, no release can be published." && exit 1
if: "env.ENABLE_RELEASE != 'true' || contains('refs/heads/build ', github.ref)"