-
Notifications
You must be signed in to change notification settings - Fork 1
96 lines (84 loc) · 2.39 KB
/
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
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
88
89
90
91
92
93
94
95
96
name: Release
on:
push:
tags:
- 'v*'
permissions:
id-token: write
contents: read
defaults:
run:
shell: bash
jobs:
release-jvm:
name: Release JVM
runs-on: ubuntu-latest
timeout-minutes: 10
env:
JAVA_OPTS: "-Xmx4G"
SBT_OPTS: "-Dsbt.ci=true"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '21'
- name: Prepare environment
env:
SONATYPE_SBT: ${{ secrets.SONATYPE_SBT }}
SONATYPE_PGP_SECRET: ${{ secrets.SONATYPE_PGP_SECRET }}
run: |
mkdir --parents ~/.sbt/1.0 || true
echo "$SONATYPE_SBT" > ~/.sbt/1.0/sonatype.sbt
echo -n "$SONATYPE_PGP_SECRET" | base64 --decode | gpg --batch --import
- name: Deploy Java adapter
id: deploy-jvm
env:
PGP_PASSPHRASE: ${{ secrets.SONATYPE_PGP_PASSPHRASE }}
working-directory: ./jvm
run: |
sbt "project gatling-jvm-to-js-adapter" "release with-defaults"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: gatling-js-workdir
path: .
retention-days: 1
release-js:
name: Release JS
needs: release-jvm
runs-on: ubuntu-latest
environment:
name: npm
url: https://www.npmjs.com/org/gatling.io
timeout-minutes: 10
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: gatling-js-workdir
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Setup version
id: version
run: |
version="$(cat jvm/adapter/target/release-info)"
echo "version=$version"
echo "version=$version" >> $GITHUB_OUTPUT
- name: Deploy JS packages
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
working-directory: ./js
run: |
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
npm ci
npm version "${{ steps.version.outputs.version }}"
npm run build --workspaces
for pkg in "cli" "jvm-types" "core" "http"; do
cp ../LICENSE "./$pkg/LICENSE"
npm publish --access public "[email protected]/$pkg"
done