Repository navigation
62 lines (55 loc) · 2.07 KB
/
Copy pathrelease.yml
File metadata and controls
62 lines (55 loc) · 2.07 KB
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
55
56
57
58
59
60
61
62
name: Create release
on:
push:
branches: [master]
permissions:
contents: read
jobs:
release:
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
runs-on: ubuntu-latest
environment: Release
permissions:
contents: write
pull-requests: write
id-token: write # required for npm trusted publishing (OIDC)
steps:
- name: Harden Runner
uses: step-security/harden-runner@bf7454d06d71f1098171f2acdf0cd4708d7b5920 # v2.20.0
with:
egress-policy: audit
- name: Generate a token
id: generate-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3
with:
app-id: ${{ secrets.RELEASER_APP_ID }}
private-key: ${{ secrets.RELEASER_PRIVATE_KEY }}
owner: coveo
repositories: 'cli'
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
fetch-depth: 0
token: ${{ steps.generate-token.outputs.token }}
- uses: ./.github/actions/setup-node
- name: Create release PR or publish
id: changesets
uses: step-security/changeset-action@6ddf46283ed49170eb6ca2179818f7d2a0ae687c # v1.9.0
with:
version: npm run version-packages
publish: npm run release
title: 'ci(changesets): version packages'
commit: 'ci(changesets): version packages'
commitMode: github-api
env:
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
# No npm token: publishing authenticates via OIDC (npm trusted
# publishing). Setting NPM_TOKEN here would make the action write a
# token-based .npmrc instead of using OIDC.
#
# npm logs the whole OIDC token exchange under the `oidc` prefix at
# verbose/silly level only, and never throws when the exchange
# fails. Without this, a broken trusted-publisher setup surfaces as
# an opaque registry error with no explanation.
NPM_CONFIG_LOGLEVEL: verbose