-
Notifications
You must be signed in to change notification settings - Fork 181
62 lines (57 loc) · 1.63 KB
/
Copy pathpublish.yml
File metadata and controls
62 lines (57 loc) · 1.63 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: Publish to npm as @next
on:
push:
branches: [master]
# Cancel in-progress runs of the same workflow
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: {}
jobs:
build:
name: Build
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Set up JDK 25
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '25'
- uses: sbt/setup-sbt@v1
- name: Prepare source files into the npm package directory
run: |
. ./setup_env.sh
cat /dev/null | sbt \
fastOptJS \
buildNpmJsFile \
buildNpmPackage
- name: Store the npm package directory
uses: actions/upload-artifact@v6
with:
name: npm-package-dir
path: js/npm/
publish:
name: Publish
runs-on: ubuntu-latest
needs:
- build
permissions:
id-token: write # Required for OIDC (see https://docs.npmjs.com/trusted-publishers)
steps:
- name: Download the npm package directory
uses: actions/download-artifact@v7
with:
name: npm-package-dir
path: js/npm/
- uses: actions/setup-node@v6
with:
package-manager-cache: false # IMPORTANT: prevents potential [cache poisoning](https://docs.zizmor.sh/audits/#cache-poisoning) attacks
node-version: '24'
registry-url: 'https://registry.npmjs.org'
- run: npm publish --tag next
working-directory: js/npm/