-
Notifications
You must be signed in to change notification settings - Fork 2
163 lines (140 loc) · 5.15 KB
/
Copy pathbuild-jlink-bundle.yml
File metadata and controls
163 lines (140 loc) · 5.15 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# Copyright (c) 2026 Gili Tzabari. All rights reserved.
#
# Licensed under the CAT Commercial License.
# See LICENSE.md in the project root for license terms.
name: Build jlink Bundle
on:
push:
branches:
- main
- 'v*'
paths:
- 'client/**'
- '.github/workflows/build-jlink-bundle.yml'
tags:
- 'v*'
workflow_dispatch:
env:
JDK_VERSION: '25'
jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-latest
platform: linux-x64
- os: ubuntu-24.04-arm
platform: linux-aarch64
- os: macos-latest
platform: macos-x64
- os: macos-latest
platform: macos-aarch64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Determine version
id: version
run: |
set -euo pipefail
if [[ "$GITHUB_REF" == refs/tags/v* ]]; then
VERSION="${GITHUB_REF#refs/tags/v}"
elif [[ "$GITHUB_REF" == refs/heads/v* ]]; then
VERSION="${GITHUB_REF#refs/heads/v}"
else
VERSION=$(grep '"version"' plugin/.claude-plugin/plugin.json | sed 's/.*"version": *"\([^"]*\)".*/\1/')
fi
if [[ -z "${VERSION}" ]]; then
echo "ERROR: Failed to determine bundle version" >&2
echo "GITHUB_REF=${GITHUB_REF}" >&2
exit 1
fi
echo "Bundle version: ${VERSION}"
echo "version=${VERSION}" >> $GITHUB_OUTPUT
- name: Set up JDK ${{ env.JDK_VERSION }}
uses: actions/setup-java@v4
with:
java-version: ${{ env.JDK_VERSION }}
distribution: 'temurin'
cache: 'maven'
- name: Verify JDK version
run: |
java -version
jlink --version
- name: Build jlink bundle
run: |
set -euo pipefail
cd client
chmod +x build-jlink.sh
./build-jlink.sh
- name: Write VERSION file into bundle
run: |
echo "${{ steps.version.outputs.version }}" > "client/target/jlink/VERSION"
- name: Package bundle
run: |
set -euo pipefail
[[ -d "client/target/jlink/bin" ]] || {
echo "ERROR: jlink output not found at client/target/jlink/bin" >&2
echo "Expected build-jlink.sh to produce client/target/jlink/ with a bin/ subdirectory" >&2
exit 1
}
BUNDLE_NAME="cat-${{ steps.version.outputs.version }}-${{ matrix.platform }}"
tar -czf "${BUNDLE_NAME}.tar.gz" -C client/target jlink
ls -lh "${BUNDLE_NAME}.tar.gz"
sha256sum "${BUNDLE_NAME}.tar.gz" > "${BUNDLE_NAME}.tar.gz.sha256"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: cat-${{ steps.version.outputs.version }}-${{ matrix.platform }}
path: |
cat-${{ steps.version.outputs.version }}-${{ matrix.platform }}.tar.gz
cat-${{ steps.version.outputs.version }}-${{ matrix.platform }}.tar.gz.sha256
release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && startsWith(github.ref, 'refs/heads/v'))
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: List artifacts
run: ls -la artifacts/
- name: Determine version
id: version
run: |
set -euo pipefail
if [[ "$GITHUB_REF" == refs/tags/v* ]]; then
echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
elif [[ "$GITHUB_REF" == refs/heads/v* ]]; then
echo "version=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
else
echo "ERROR: Cannot determine release version from GITHUB_REF=${GITHUB_REF}" >&2
exit 1
fi
- name: Create or update release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.version.outputs.version }}
name: CAT Bundle ${{ steps.version.outputs.version }}
body: |
## CAT Bundle
Pre-built jlinked runtime (JDK ${{ env.JDK_VERSION }} + cat-hooks.jar + Jackson) for CAT plugin hooks.
### Platforms
- `cat-${{ steps.version.outputs.version }}-linux-x64.tar.gz` - Linux x86_64
- `cat-${{ steps.version.outputs.version }}-linux-aarch64.tar.gz` - Linux ARM64
- `cat-${{ steps.version.outputs.version }}-macos-x64.tar.gz` - macOS Intel
- `cat-${{ steps.version.outputs.version }}-macos-aarch64.tar.gz` - macOS Apple Silicon
### Installation
The CAT plugin automatically downloads the appropriate bundle on first use.
For manual installation, extract to `~/.config/claude/cat-runtime/`.
### Verification
SHA256 checksums are provided for each bundle.
files: |
artifacts/*.tar.gz
artifacts/*.sha256
draft: false
prerelease: false