Repository navigation
237 lines (220 loc) · 10.9 KB
/
Copy pathdeploy.yml
File metadata and controls
237 lines (220 loc) · 10.9 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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
name: Deploy update site
# Cross-compiles the native library for all 9 platform/arch combinations,
# builds the plugin/feature/site with Tycho against those freshly-built
# binaries, and publishes straight to GitHub Pages as a build artifact --
# no git commit involved anywhere in this pipeline.
#
# Manual only: nothing publishes without someone with write access
# explicitly clicking "Run workflow".
on:
workflow_dispatch: {}
permissions:
contents: read
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
# --- Native library cross-compile matrix -----------------------------
# One action across all 9 targets, matching actions-rust-cross's own
# documented usage pattern: it decides internally whether a given
# (runs-on, target) pair needs cross-rs/cross or can just run cargo
# directly (Windows and macOS fall in the latter case). Every Linux and
# FreeBSD target goes through cross-rs/cross -- Linux x86_64 only because
# force-cross says so, see its matrix entry -- which maintains a tested
# Docker image per target --
# including solved versions of the two hardest problems here (riscv64's
# toolchain needing a newer binutils than Debian stable ships, and a real
# clang+sysroot cross-compiler for FreeBSD, aarch64 included).
#
# Explicit -gnu targets on Linux, not the action's own example (which
# uses musl): the existing binaries are glibc-linked, and switching libc
# should be a deliberate choice, not a side effect of copying an example.
native:
name: native (${{ matrix.target }})
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-pc-windows-msvc
runs-on: windows-latest
artifact: native-windows-x86_64
binary: claude_eclipse_core.dll
- target: aarch64-pc-windows-msvc
runs-on: windows-latest
artifact: native-windows-aarch64
binary: claude_eclipse_core.dll
- target: aarch64-apple-darwin
runs-on: macos-latest
artifact: native-macos-aarch64
binary: libclaude_eclipse_core.dylib
- target: x86_64-apple-darwin
runs-on: macos-latest
artifact: native-macos-x86_64
binary: libclaude_eclipse_core.dylib
# A plain cargo build here links against the runner's own glibc
# (2.39 on ubuntu-24.04), which no older distro can load. cross's
# image is Ubuntu 16.04, the same base the aarch64 build uses.
- target: x86_64-unknown-linux-gnu
runs-on: ubuntu-latest
artifact: native-linux-x86_64
binary: libclaude_eclipse_core.so
force-cross: true
- target: aarch64-unknown-linux-gnu
runs-on: ubuntu-latest
artifact: native-linux-aarch64
binary: libclaude_eclipse_core.so
- target: riscv64gc-unknown-linux-gnu
runs-on: ubuntu-latest
artifact: native-linux-riscv64
binary: libclaude_eclipse_core.so
- target: x86_64-unknown-freebsd
runs-on: ubuntu-latest
artifact: native-freebsd-x86_64
binary: libclaude_eclipse_core.so
# cross has a Dockerfile for this target in its own source tree,
# but doesn't ship it as a default auto-selected image ("cross
# does not provide a Docker image for target aarch64-unknown-
# freebsd, specify a custom image in Cross.toml" -- confirmed by
# an actual run). Without it, cross silently built with the
# host's native x86_64 toolchain instead, which can't link
# aarch64 objects at all. claude-eclipse-core/Cross.toml points
# this target at cross-rs's own published image for it.
- target: aarch64-unknown-freebsd
runs-on: ubuntu-latest
artifact: native-freebsd-aarch64
binary: libclaude_eclipse_core.so
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: houseabsolute/actions-rust-cross@21b0f18dc621b25bfae556ff2791fca4173121e8 # v1.0.8
with:
command: build
target: ${{ matrix.target }}
args: --release
working-directory: claude-eclipse-core
strip: true
# Pinned: each cross release ships new images, and the image's
# libc is what sets the oldest system the library loads on.
cross-version: v0.2.5
force-use-cross: ${{ matrix.force-cross || false }}
# Linux support reaches as far back as possible, so fail rather than
# publish a library that needs a newer libc than these. 2.27 is the
# oldest glibc with riscv64 at all; FBSD_1.7 is the FreeBSD 14 series.
- name: Enforce the libc floor
if: contains(matrix.target, 'linux') || contains(matrix.target, 'freebsd')
shell: bash
run: |
set -eu
f=claude-eclipse-core/target/${{ matrix.target }}/release/${{ matrix.binary }}
case "${{ matrix.target }}" in
*linux*) max=GLIBC_2.27 ;;
*freebsd*) max=FBSD_1.7 ;;
esac
got=$(readelf -V --wide "$f" | grep -oE '(GLIBC_2|FBSD_1)\.[0-9]+' | sort -V | tail -1)
if [ -z "$got" ]; then
echo "::error::no libc version requirements found in $f"
exit 1
fi
echo "$f needs $got (allowed: $max)"
if [ "$(printf '%s\n%s\n' "$got" "$max" | sort -V | tail -1)" != "$max" ]; then
echo "::error::${{ matrix.target }} needs $got, newer than $max"
exit 1
fi
# The linker only ad-hoc signs arm64 output, and stripping can void a
# signature, so re-sign both macOS dylibs the way the Mac-built ones
# have always shipped (a signature with no identity behind it).
- name: Ad-hoc sign the macOS dylib
if: runner.os == 'macOS'
run: |
set -eu
f=claude-eclipse-core/target/${{ matrix.target }}/release/${{ matrix.binary }}
codesign --force --sign - "$f"
codesign --verify --verbose "$f"
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: ${{ matrix.artifact }}
path: claude-eclipse-core/target/${{ matrix.target }}/release/${{ matrix.binary }}
# --- Build + publish ---------------------------------------------------
build:
name: Build p2 site with Tycho
needs: native
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
pattern: native-*
path: downloaded-natives
- name: Place native libraries
run: |
set -eu
base=com.anthropic.claudecode.eclipse/native
mkdir -p "$base"/windows/x86_64 "$base"/windows/aarch64
mkdir -p "$base"/linux/x86_64 "$base"/linux/aarch64 "$base"/linux/riscv64
mkdir -p "$base"/freebsd/x86_64 "$base"/freebsd/aarch64
mkdir -p "$base"/macos/aarch64 "$base"/macos/x86_64
cp downloaded-natives/native-windows-x86_64/claude_eclipse_core.dll "$base"/windows/x86_64/
cp downloaded-natives/native-windows-aarch64/claude_eclipse_core.dll "$base"/windows/aarch64/
cp downloaded-natives/native-linux-x86_64/libclaude_eclipse_core.so "$base"/linux/x86_64/
cp downloaded-natives/native-linux-aarch64/libclaude_eclipse_core.so "$base"/linux/aarch64/
cp downloaded-natives/native-linux-riscv64/libclaude_eclipse_core.so "$base"/linux/riscv64/
cp downloaded-natives/native-freebsd-x86_64/libclaude_eclipse_core.so "$base"/freebsd/x86_64/
cp downloaded-natives/native-freebsd-aarch64/libclaude_eclipse_core.so "$base"/freebsd/aarch64/
cp downloaded-natives/native-macos-aarch64/libclaude_eclipse_core.dylib "$base"/macos/aarch64/
cp downloaded-natives/native-macos-x86_64/libclaude_eclipse_core.dylib "$base"/macos/x86_64/
- uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0
with:
distribution: temurin
java-version: "21"
# The plugin jar carries the Rust sources under src/core/ (see
# bin.includes in build.properties). They are copied in at build
# time only and never committed -- .gitignore excludes the folder.
- name: Copy the Rust sources into src/core
run: |
set -eu
mkdir -p com.anthropic.claudecode.eclipse/src/core
cp -r claude-eclipse-core/src/. com.anthropic.claudecode.eclipse/src/core/
# The command menu's Changelog window reads CHANGELOG.md from the
# bundle's resources/ (ClaudeGuiView#changelogText). Copied in like
# src/core/ above, never committed -- .gitignore excludes the copy.
- name: Copy CHANGELOG.md into the plugin's resources
run: cp CHANGELOG.md com.anthropic.claudecode.eclipse/resources/CHANGELOG.md
# The runner image brings its own Maven and replaces it on its own
# schedule: 3.10.0 came with image 20261004, and tycho-surefire stopped
# resolving the test dependencies ("Invalid Collect Request"). The
# build uses the version it was last verified with instead.
- name: Install Maven 3.9.16
run: |
set -eu
v=3.9.16
curl -fsSL -o "$RUNNER_TEMP/maven.tar.gz" "https://archive.apache.org/dist/maven/maven-3/$v/binaries/apache-maven-$v-bin.tar.gz"
echo "831a8591fe20c8243b1dbe7d71e3244f31d1665b0804b2e825e38cbbe5ce0cafb8338851f90780735568773e0a6cd07bbec107cda0b896b008b861075358b6f6 $RUNNER_TEMP/maven.tar.gz" | sha512sum -c -
tar -xzf "$RUNNER_TEMP/maven.tar.gz" -C "$RUNNER_TEMP"
echo "$RUNNER_TEMP/apache-maven-$v/bin" >> "$GITHUB_PATH"
"$RUNNER_TEMP/apache-maven-$v/bin/mvn" -v
- run: mvn -B integration-test
# Keep the published p2 site at the same path it has always lived at
# (.../com.anthropic.claudecode.eclipse.site/) rather than the Pages
# root, since every existing install's update-site URL and the
# README's install instructions already point there.
- name: Stage p2 site at its historical path
run: |
mkdir -p _site/com.anthropic.claudecode.eclipse.site
cp -r com.anthropic.claudecode.eclipse.site/target/repository/. _site/com.anthropic.claudecode.eclipse.site/
- uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
- uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: _site
deploy:
name: Publish to GitHub Pages
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1