-
-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (71 loc) · 2.09 KB
/
release-please.yml
File metadata and controls
85 lines (71 loc) · 2.09 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Release Please
on:
push:
branches:
- master
release:
types: [published]
workflow_dispatch:
inputs:
tag:
description: 'Publish an existing release tag (e.g. v1.1.0)'
required: true
permissions:
contents: write
pull-requests: write
id-token: write
jobs:
release-please:
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Generate app token
id: app-token
uses: actions/create-github-app-token@v3
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- uses: googleapis/release-please-action@v5
with:
token: ${{ steps.app-token.outputs.token }}
release-type: node
publish:
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- name: Determine tag
id: tag
run: |
if [ "${{ github.event_name }}" = "release" ]; then
echo "ref=${{ github.event.release.tag_name }}" >> "$GITHUB_OUTPUT"
else
echo "ref=${{ inputs.tag }}" >> "$GITHUB_OUTPUT"
fi
- name: Checkout code
uses: actions/checkout@v6
with:
ref: ${{ steps.tag.outputs.ref }}
- name: Setup pnpm
uses: pnpm/action-setup@v5
with:
version: 10
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '20'
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build package
run: pnpm run build
- name: Update npm for OIDC trusted publishing
run: npm install -g npm@latest
- name: Publish to npm
run: npm publish --access public --provenance
- name: Generate SBOM
run: pnpm run sbom
- name: Upload SBOM to release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ steps.tag.outputs.ref }} sbom.cdx.json --clobber