-
Notifications
You must be signed in to change notification settings - Fork 33
87 lines (81 loc) · 2.69 KB
/
release-please.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
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
86
87
on:
push:
branches:
- main
name: Run Release Please
jobs:
release-please:
runs-on: ubuntu-latest
# Release-please creates a PR that tracks all changes
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
command: manifest
token: ${{secrets.RELEASE_PLEASE_ACTION_TOKEN}}
default-branch: main
signoff: "OpenFeature Bot <[email protected]>"
outputs:
release_created: ${{ steps.release.outputs.releases_created }}
all: ${{ toJSON(steps.release.outputs) }}
paths_released: ${{ steps.release.outputs.paths_released }}
sbom:
needs: release-please
runs-on: ubuntu-latest
if: ${{ fromJSON(needs.release-please.outputs.paths_released)[0] != null }}
# Continues with the release process even if SBOM generation fails.
continue-on-error: true
strategy:
matrix:
release: ${{ fromJSON(needs.release-please.outputs.paths_released) }}
env:
TAG: ${{ fromJSON(needs.release-please.outputs.all)[format('{0}--tag_name', matrix.release)] }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
- name: Generate SBOM
run: |
npm install -g npm@^10.2.0
npm ci
npm sbom --sbom-format=cyclonedx --omit=dev --omit=peer --workspace=${{matrix.release}} > bom.json
- name: Attach SBOM to artifact
env:
GITHUB_TOKEN: ${{secrets.RELEASE_PLEASE_ACTION_TOKEN}}
run:
gh release upload $TAG bom.json
npm-release:
needs: release-please
runs-on: ubuntu-latest
if: ${{ needs.release-please.outputs.release_created }}
steps:
# The logic below handles the npm publication:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
registry-url: "https://registry.npmjs.org"
cache: 'npm'
- name: Build Packages
run: |
npm ci
npm run build
# need to publish all unpublished versions to NPM here
# Our scripts only publish versions that do not already exist.
- name: Publish to NPM
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
run: npm run publish-all
- name: Build Docs
run: npm run docs
- name: Deploy Documentation 🚀
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: typedoc