-
Notifications
You must be signed in to change notification settings - Fork 0
115 lines (111 loc) · 3.81 KB
/
Copy pathci.yml
File metadata and controls
115 lines (111 loc) · 3.81 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: CI
on:
push:
branches: [main]
tags: ['[0-9]*.[0-9]*.[0-9]*']
pull_request:
branches: [main]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: 'maven'
- name: Build, unit tests + integration tests
run: mvn -B verify
native:
needs: build
if: startsWith(github.ref, 'refs/tags/')
strategy:
matrix:
include:
- os: ubuntu-latest
label: linux-amd64
binary: qtsurfer-mcp
asset: qtsurfer-mcp-linux-amd64
- os: macos-latest
label: macos-arm64
binary: qtsurfer-mcp
asset: qtsurfer-mcp-macos-arm64
- os: windows-latest
label: windows-amd64
binary: qtsurfer-mcp.exe
asset: qtsurfer-mcp-windows-amd64.exe
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'graalvm'
cache: 'maven'
- name: Set up MSVC (required by GraalVM native-image on Windows)
if: matrix.os == 'windows-latest'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Build native binary
run: mvn -B -Pnative -DskipTests package native:compile-no-fork
- name: Upload native binary
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.asset }}
path: target/${{ matrix.binary }}
retention-days: 1
release:
needs: [build, native]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: 'maven'
- name: Build fat JAR
run: mvn -B package -DskipTests
- name: Download native binaries
uses: actions/download-artifact@v4
with:
path: native-binaries
- name: Create GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: |
awk "/^## \[${GITHUB_REF_NAME}\]/{found=1; next} found && /^## \[/{exit} found{print}" \
CHANGELOG.md > /tmp/release-notes.md
gh release create "$GITHUB_REF_NAME" \
--title "$GITHUB_REF_NAME" \
--notes-file /tmp/release-notes.md
- name: Upload fat JAR
env:
GH_TOKEN: ${{ github.token }}
run: |
JAR=$(ls target/mcp-java-*.jar | grep -v 'original-' | head -1)
cp "$JAR" "qtsurfer-mcp-java-${GITHUB_REF_NAME}.jar"
cp "$JAR" "qtsurfer-mcp-java.jar"
gh release upload "$GITHUB_REF_NAME" \
"qtsurfer-mcp-java-${GITHUB_REF_NAME}.jar" \
"qtsurfer-mcp-java.jar"
- name: Upload native binaries
env:
GH_TOKEN: ${{ github.token }}
run: |
mv native-binaries/qtsurfer-mcp-linux-amd64/qtsurfer-mcp \
native-binaries/qtsurfer-mcp-linux-amd64/qtsurfer-mcp-linux-amd64
mv native-binaries/qtsurfer-mcp-macos-arm64/qtsurfer-mcp \
native-binaries/qtsurfer-mcp-macos-arm64/qtsurfer-mcp-macos-arm64
mv "native-binaries/qtsurfer-mcp-windows-amd64.exe/qtsurfer-mcp.exe" \
"native-binaries/qtsurfer-mcp-windows-amd64.exe/qtsurfer-mcp-windows-amd64.exe"
gh release upload "$GITHUB_REF_NAME" \
native-binaries/qtsurfer-mcp-linux-amd64/qtsurfer-mcp-linux-amd64 \
native-binaries/qtsurfer-mcp-macos-arm64/qtsurfer-mcp-macos-arm64 \
"native-binaries/qtsurfer-mcp-windows-amd64.exe/qtsurfer-mcp-windows-amd64.exe"