-
Notifications
You must be signed in to change notification settings - Fork 8
70 lines (61 loc) · 1.98 KB
/
pkg-js-release.yaml
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
name: Release (JS)
on:
workflow_dispatch:
push:
tags:
- "pkg/js/v*"
jobs:
test:
uses: ./.github/workflows/pkg-js-build.yaml
secrets: inherit
publish:
needs: [test]
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
defaults:
run:
working-directory: "pkg/js"
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
path: "."
## TODO: We need to comment these out b/c we are copying the main README as part of the publish process
## Once we have a README specific to the JS package, we can re-include them
# sparse-checkout: "pkg/js"
# sparse-checkout-cone-mode: false
- name: Set up node
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 20
registry-url: "https://registry.npmjs.org"
scope: "@openfga"
always-auth: false
cache: "npm"
cache-dependency-path: ./pkg/js/package-lock.json
- name: Install dependencies
run: npm ci
- name: Publish to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
release:
runs-on: ubuntu-latest
needs: [publish]
permissions:
contents: write
packages: write # publish a new github release
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- uses: Roang-zero1/github-create-release-action@57eb9bdce7a964e48788b9e78b5ac766cb684803 # v3.0.1
with:
version_regex: ^pkg/js/v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+
prerelease_regex: ^pkg/js/v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+-(alpha|beta)\.[[:digit:]]+$
changelog_file: pkg/js/CHANGELOG.md
create_draft: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}