Repository navigation
78 lines (66 loc) · 2.07 KB
/
Copy pathrelease.yml
File metadata and controls
78 lines (66 loc) · 2.07 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
on:
release:
types: [created]
name: Release
permissions:
id-token: write
contents: write
jobs:
build:
runs-on: ubuntu-latest
name: Build Runtime JAR
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Get Release Details
id: get_release
uses: bruceadams/get-release@v1.2.2
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Set up JDK
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '25'
java-package: jdk
- name: Build Maven project
run: mvn package
- name: Upload Maven build output
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./target/runtime.jar
asset_name: runtime.jar
asset_content_type: application/octet-stream
release:
runs-on: ubuntu-latest
name: Publish TypeScript Types
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v6
with:
node-version: '24'
registry-url: https://registry.npmjs.org
package-manager-cache: false
- name: Update version in package.json
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const fs = require('fs');
const packageJson = JSON.parse(fs.readFileSync('src/typescript/package.json', 'utf8'));
packageJson.version = '${{ github.event.release.tag_name }}'.replace(/^v/, '');
fs.writeFileSync('src/typescript/package.json', JSON.stringify(packageJson, null, 2));
- name: Publish to npm
working-directory: src/typescript
run: npm publish