-
Notifications
You must be signed in to change notification settings - Fork 2
48 lines (46 loc) · 1.49 KB
/
npm-release.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
name: Release npm package
on:
push:
tags:
- 'v*'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
pkg:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '23.x'
registry-url: https://registry.npmjs.org/
- uses: coursier/cache-action@v6
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- uses: sbt/setup-sbt@v1
- name: Release
run: |
sudo apt update -y
sudo apt install -y zlib1g php-zip
sbt scalafmtCheck stage createDistribution
sha512sum target/atom.zip > target/atom.zip.sha512
npm config set //npm.pkg.github.com/:_authToken=$GITHUB_TOKEN
npm config set //registry.npmjs.org/:_authToken=$NPMJS_AUTH_TOKEN
cd wrapper/nodejs
bash build.sh
echo "appthreat:registry=https://npm.pkg.github.com" > ~/.npmrc
npm publish --access=public --@appthreat:registry='https://npm.pkg.github.com'
echo "appthreat:registry=https://registry.npmjs.org" > ~/.npmrc
npm publish --provenance --access=public --@appthreat:registry='https://registry.npmjs.org'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPMJS_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}