-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (62 loc) · 2.01 KB
/
release-please.yml
File metadata and controls
73 lines (62 loc) · 2.01 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
on:
push:
branches:
- main
name: Run Release Please
permissions:
contents: read
jobs:
release-please:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ secrets.RELEASE_PLEASE_ACTION_TOKEN }}
outputs:
release_created: ${{ steps.release.outputs['packages/js-ofrep-worker--release_created'] }}
release_tag_name: ${{ steps.release.outputs['packages/js-ofrep-worker--tag_name'] }}
npm-release:
needs: release-please
runs-on: ubuntu-latest
if: ${{ fromJSON(needs.release-please.outputs.release_created || 'false') }}
environment: publish
permissions:
id-token: write
attestations: write
contents: write
steps:
- name: Checkout Repository
uses: actions/checkout@v5
- name: Setup Node
uses: actions/setup-node@v5
with:
node-version: 24
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
- name: Update npm to >=11.5.1 (for OIDC support)
run: npm install -g npm@^11.5.1
- name: Install dependencies
run: npm ci
- name: Build package
run: npm run build
- name: Generate SBOM
run: npm sbom --sbom-format=cyclonedx --omit=dev --omit=peer --workspace=packages/js-ofrep-worker > sbom.json
- name: Attest SBOM
uses: actions/attest-sbom@v3
with:
subject-path: packages/js-ofrep-worker/package.json
sbom-path: ./sbom.json
- name: Publish to npm
working-directory: packages/js-ofrep-worker
run: |
PACKAGE_NAME=$(node -p "require('./package.json').name")
VERSION=$(node -p "require('./package.json').version")
if npm view "$PACKAGE_NAME@$VERSION" > /dev/null 2>&1; then
echo "$PACKAGE_NAME@$VERSION already published"
else
npm publish --provenance --access public
fi