-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (50 loc) · 1.86 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Release
on:
push:
branches:
- main
workflow_dispatch:
concurrency: ${{ github.workflow }}-${{ github.ref }}
permissions: {}
jobs:
release:
# do not run on forks
if: github.repository == 'woltapp/browserbug'
permissions:
pull-requests: write # to create a release pull request (changesets/action)
contents: write # to create the release itself (changesets/action)
id-token: write # OpenID Connect token needed for npm publish provenance
packages: write # to publish to GitHub packages
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
# This makes Actions fetch all Git history so that Changesets can
# generate changelogs with the correct commits
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- run: corepack enable
- run: pnpm install
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
# Calls out to `changeset version` and also updates the lockfile,
# which Changesets does not do out of the box.
version: pnpm changeset:version
# We use a recursive pnpm script under the hood, to ensure that
# publishing runs topologically. Changesets does not do this out of
# the box. @see: https://github.com/changesets/changesets/issues/238
publish: pnpm changeset:release
env:
# Used to write releases and create the PR
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Used to actually publish to the NPM registry; this is set as a
# repository secret
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
NPM_CONFIG_PROVENANCE: true