forked from bensku/java-ts-bind
-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (41 loc) · 1.55 KB
/
build.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
name: Java build
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v3
with:
distribution: 'adopt' # See 'Supported distributions' for available options
java-version: '21'
- name: Gradle build
run: ./gradlew shadowJar
- name: Download JDK sources
run: |
sudo apt-get update
sudo apt-get install -y openjdk-21-source
- name: Generate java.base types
run: >-
java -jar build/libs/java-ts-bind-all.jar --packageJson java-core-types/package.json
- name: Generate java.net.http types
run: >-
java -jar build/libs/java-ts-bind-all.jar --packageJson httpclient-types/package.json
- uses: actions/setup-node@master
with:
registry-url: 'https://registry.npmjs.org'
if: github.ref == 'refs/heads/master'
- name: Publish core types
run: |
sed -i "s/VERSION/21.0.4-$(git rev-parse --short $GITHUB_SHA)/g" java-core-types/package.json
npm publish --access=public ./java-core-types
if: github.ref == 'refs/heads/master'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Publish HttpClient types
run: |
sed -i "s/VERSION/21.0.4-$(git rev-parse --short $GITHUB_SHA)/g" httpclient-types/package.json
npm publish --access=public ./httpclient-types
if: github.ref == 'refs/heads/master'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}