forked from kohsuke/com4j
-
Notifications
You must be signed in to change notification settings - Fork 2
55 lines (47 loc) · 1.77 KB
/
Copy pathrelease.yml
File metadata and controls
55 lines (47 loc) · 1.77 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
name: Release
on:
release:
types: [published]
permissions:
contents: write
jobs:
build-and-upload:
runs-on: windows-2022
steps:
- name: Check out repository (with submodules) at the release tag
uses: actions/checkout@v7
with:
submodules: recursive
ref: ${{ github.event.release.tag_name }}
- name: Set up JDK
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '17'
cache: maven
# Sets the version to the release tag
- name: Set version to release tag
shell: pwsh
run: mvn -B versions:set "-DnewVersion=${{ github.event.release.tag_name }}" -DgenerateBackupPoms=false
# Rebuilds native/com4j.dll (Release, x86+x64) from source rather than
# trusting whatever's committed, so the uploaded jar always reflects
# the exact code at this tag.
- name: Build native (Release) and package
shell: pwsh
run: mvn -B -pl "!test" package -DbuildNative=true -Dmode=Release
# Uploads all modules' built artifacts as release assets
- name: Upload build artifacts to the release
shell: pwsh
env:
GH_TOKEN: ${{ github.token }}
run: |
function Latest($pattern) {
(Get-ChildItem $pattern | Sort-Object LastWriteTime -Descending | Select-Object -First 1).FullName
}
$files = @(
Latest "runtime/target/com4j-*.jar"
Latest "tlbimp/target/tlbimp-*.jar"
Latest "maven-com4j-plugin/target/maven-com4j-plugin-*.jar"
Latest "distribution/target/com4j-dist-*-all.zip"
)
gh release upload "${{ github.event.release.tag_name }}" $files --repo ${{ github.repository }} --clobber