Skip to content

Commit 4e8948d

Browse files
committed
Add GitHub Actions for ark-lsp and VS Code extension releases
Extend existing release workflows to build ark-lsp binaries and platform-specific VS Code extensions (.vsix files) as part of the unified ark release process. Changes: - release-linux.yml: Build and archive ark-lsp alongside ark - release-macos.yml: Build ark-lsp per-arch, create universal binary with lipo - release-windows.yml: Build, sign, and archive ark-lsp alongside ark - release-vscode.yml: New workflow to package platform-specific .vsix files - release.yml: Orchestrate vscode build, download/upload ark-lsp and .vsix - bundle.js: Support CI mode (skip copy if binary pre-placed) - package.json: Add package:target script for platform packaging
1 parent 63adf28 commit 4e8948d

File tree

7 files changed

+442
-14
lines changed

7 files changed

+442
-14
lines changed

.github/workflows/release-linux.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
cargo zigbuild --target ${ARCH_FLAG}-unknown-linux-gnu.$GLIBC_MAX_VERSION $TARGET_FLAG
5858
5959
# Compress kernel to a zip file
60-
- name: Create archive
60+
- name: Create ark archive
6161
run: |
6262
# Enter the build directory
6363
pushd target/${ARCH_FLAG}-unknown-linux-gnu/${{ matrix.flavor }}
@@ -70,8 +70,27 @@ jobs:
7070
7171
popd
7272
73-
- name: Upload archive
73+
- name: Upload ark archive
7474
uses: actions/upload-artifact@v4
7575
with:
7676
name: ark-${{ matrix.flavor }}-linux-${{ matrix.arch }}-archive
7777
path: ark-${{ inputs.version }}${{ env.DEBUG_FLAG }}-linux-${{ matrix.arch }}.zip
78+
79+
- name: Create ark-lsp archive
80+
run: |
81+
# Enter the build directory
82+
pushd target/${ARCH_FLAG}-unknown-linux-gnu/${{ matrix.flavor }}
83+
84+
# Compress ark-lsp to an archive
85+
ARCHIVE="$GITHUB_WORKSPACE/ark-lsp-${{ inputs.version }}${{ env.DEBUG_FLAG }}-linux-${{ matrix.arch }}.zip"
86+
[ -e LICENSE ] || cp "$GITHUB_WORKSPACE/LICENSE" LICENSE
87+
[ -e NOTICE ] || cp "$GITHUB_WORKSPACE/crates/ark/NOTICE" NOTICE
88+
zip -Xry $ARCHIVE ark-lsp LICENSE NOTICE
89+
90+
popd
91+
92+
- name: Upload ark-lsp archive
93+
uses: actions/upload-artifact@v4
94+
with:
95+
name: ark-lsp-${{ matrix.flavor }}-linux-${{ matrix.arch }}-archive
96+
path: ark-lsp-${{ inputs.version }}${{ env.DEBUG_FLAG }}-linux-${{ matrix.arch }}.zip

.github/workflows/release-macos.yml

Lines changed: 62 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
cargo build ${{ matrix.flavor == 'release' && '--release' || '' }} --target ${{ matrix.rust_target_prefix }}-apple-darwin
8383
8484
# Compress kernel to a zip file
85-
- name: Create archive
85+
- name: Create ark archive
8686
run: |
8787
# Enter the build directory
8888
pushd target/${{ matrix.rust_target_prefix }}-apple-darwin/${{ matrix.flavor }}
@@ -94,12 +94,31 @@ jobs:
9494
popd
9595
9696
# Create build artifact
97-
- name: Upload client archive
97+
- name: Upload ark archive
9898
uses: actions/upload-artifact@v4
9999
with:
100100
name: ark-${{ matrix.flavor }}-darwin-${{ matrix.arch }}-archive
101101
path: ark-${{ inputs.version }}-${{ matrix.flavor }}-darwin-${{ matrix.arch }}.zip
102102

103+
# Compress ark-lsp to a zip file
104+
- name: Create ark-lsp archive
105+
run: |
106+
# Enter the build directory
107+
pushd target/${{ matrix.rust_target_prefix }}-apple-darwin/${{ matrix.flavor }}
108+
109+
# Compress ark-lsp to an archive
110+
ARCHIVE="$GITHUB_WORKSPACE/ark-lsp-${{ inputs.version }}-${{ matrix.flavor }}-darwin-${{ matrix.arch }}.zip"
111+
zip -Xry $ARCHIVE ark-lsp
112+
113+
popd
114+
115+
# Create build artifact for ark-lsp
116+
- name: Upload ark-lsp archive
117+
uses: actions/upload-artifact@v4
118+
with:
119+
name: ark-lsp-${{ matrix.flavor }}-darwin-${{ matrix.arch }}-archive
120+
path: ark-lsp-${{ inputs.version }}-${{ matrix.flavor }}-darwin-${{ matrix.arch }}.zip
121+
103122

104123
build_universal:
105124
name: Build macOS universal binary
@@ -132,8 +151,18 @@ jobs:
132151
with:
133152
name: ark-${{ matrix.flavor }}-darwin-x64-archive
134153

154+
- name: Download macOS arm64 ark-lsp (${{ matrix.flavor }})
155+
uses: actions/download-artifact@v4
156+
with:
157+
name: ark-lsp-${{ matrix.flavor }}-darwin-arm64-archive
158+
159+
- name: Download macOS x64 ark-lsp (${{ matrix.flavor}})
160+
uses: actions/download-artifact@v4
161+
with:
162+
name: ark-lsp-${{ matrix.flavor }}-darwin-x64-archive
163+
135164
# Combine macOS binaries to a single binary with lipo
136-
- name: Create macOS universal binary
165+
- name: Create macOS universal binary for ark
137166
run: |
138167
# Decompress x64 builds
139168
rm -rf x64 && mkdir x64
@@ -156,8 +185,37 @@ jobs:
156185
[ -e NOTICE ] || cp "$GITHUB_WORKSPACE/crates/ark/NOTICE" NOTICE
157186
zip -Xry $ARCHIVE ark LICENSE NOTICE
158187
159-
- name: Upload client archive
188+
- name: Create macOS universal binary for ark-lsp
189+
run: |
190+
# Decompress x64 builds
191+
rm -rf x64-lsp && mkdir x64-lsp
192+
pushd x64-lsp
193+
unzip ../ark-lsp-${{ inputs.version }}-${{ matrix.flavor }}-darwin-x64.zip
194+
popd
195+
196+
# Decompress arm64 build
197+
rm -rf arm64-lsp && mkdir arm64-lsp
198+
pushd arm64-lsp
199+
unzip ../ark-lsp-${{ inputs.version }}-${{ matrix.flavor }}-darwin-arm64.zip
200+
popd
201+
202+
# Create a universal binary
203+
lipo -create x64-lsp/ark-lsp arm64-lsp/ark-lsp -output ark-lsp
204+
205+
# Compress and bundle licenses
206+
ARCHIVE="$GITHUB_WORKSPACE/ark-lsp-${{ inputs.version }}${{ env.DEBUG_FLAG }}-darwin-universal.zip"
207+
[ -e LICENSE ] || cp "$GITHUB_WORKSPACE/LICENSE" LICENSE
208+
[ -e NOTICE ] || cp "$GITHUB_WORKSPACE/crates/ark/NOTICE" NOTICE
209+
zip -Xry $ARCHIVE ark-lsp LICENSE NOTICE
210+
211+
- name: Upload ark archive
160212
uses: actions/upload-artifact@v4
161213
with:
162214
name: ark-${{ matrix.flavor }}-darwin-universal-archive
163215
path: ark-${{ inputs.version }}${{ env.DEBUG_FLAG }}-darwin-universal.zip
216+
217+
- name: Upload ark-lsp archive
218+
uses: actions/upload-artifact@v4
219+
with:
220+
name: ark-lsp-${{ matrix.flavor }}-darwin-universal-archive
221+
path: ark-lsp-${{ inputs.version }}${{ env.DEBUG_FLAG }}-darwin-universal.zip
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: "Build VS Code Extension"
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
version:
7+
required: true
8+
description: "The Ark version"
9+
type: string
10+
workflow_dispatch:
11+
inputs:
12+
version:
13+
required: false
14+
description: "The Ark version"
15+
default: dev
16+
type: string
17+
18+
jobs:
19+
build_vscode:
20+
name: Build VS Code Extension
21+
runs-on: ubuntu-latest
22+
timeout-minutes: 30
23+
24+
env:
25+
DEBUG_FLAG: ${{ matrix.flavor == 'debug' && '-debug' || '' }}
26+
27+
strategy:
28+
matrix:
29+
flavor: [release]
30+
target:
31+
- vscode_target: darwin-x64
32+
ark_lsp_artifact: ark-lsp-release-darwin-universal-archive
33+
ark_lsp_zip: ark-lsp-$VERSION-darwin-universal.zip
34+
binary_name: ark-lsp
35+
- vscode_target: darwin-arm64
36+
ark_lsp_artifact: ark-lsp-release-darwin-universal-archive
37+
ark_lsp_zip: ark-lsp-$VERSION-darwin-universal.zip
38+
binary_name: ark-lsp
39+
- vscode_target: linux-x64
40+
ark_lsp_artifact: ark-lsp-release-linux-x64-archive
41+
ark_lsp_zip: ark-lsp-$VERSION-linux-x64.zip
42+
binary_name: ark-lsp
43+
- vscode_target: linux-arm64
44+
ark_lsp_artifact: ark-lsp-release-linux-arm64-archive
45+
ark_lsp_zip: ark-lsp-$VERSION-linux-arm64.zip
46+
binary_name: ark-lsp
47+
- vscode_target: win32-x64
48+
ark_lsp_artifact: ark-lsp-release-windows-x64-archive
49+
ark_lsp_zip: ark-lsp-$VERSION-windows-x64.zip
50+
binary_name: ark-lsp.exe
51+
- vscode_target: win32-arm64
52+
ark_lsp_artifact: ark-lsp-release-windows-arm64-archive
53+
ark_lsp_zip: ark-lsp-$VERSION-windows-arm64.zip
54+
binary_name: ark-lsp.exe
55+
56+
steps:
57+
- name: Checkout sources
58+
uses: actions/checkout@v4
59+
60+
- name: Setup Node.js
61+
uses: actions/setup-node@v4
62+
with:
63+
node-version: '20'
64+
65+
- name: Download ark-lsp binary
66+
uses: actions/download-artifact@v4
67+
with:
68+
name: ${{ matrix.target.ark_lsp_artifact }}
69+
path: ark-lsp-download
70+
71+
- name: Extract and place ark-lsp binary
72+
run: |
73+
VERSION="${{ inputs.version }}"
74+
ZIP_NAME=$(echo "${{ matrix.target.ark_lsp_zip }}" | sed "s/\$VERSION/$VERSION/g")
75+
76+
cd ark-lsp-download
77+
unzip "$ZIP_NAME"
78+
79+
cd ../editors/vscode
80+
mkdir -p bin
81+
cp "../../ark-lsp-download/${{ matrix.target.binary_name }}" "bin/${{ matrix.target.binary_name }}"
82+
chmod +x "bin/${{ matrix.target.binary_name }}"
83+
84+
- name: Update extension version
85+
working-directory: editors/vscode
86+
run: |
87+
# Update package.json version to match ark version
88+
npm pkg set version="${{ inputs.version }}"
89+
90+
- name: Install dependencies
91+
working-directory: editors/vscode
92+
run: npm ci
93+
94+
- name: Compile TypeScript
95+
working-directory: editors/vscode
96+
run: npm run compile
97+
98+
- name: Package extension
99+
working-directory: editors/vscode
100+
run: npx vsce package --target ${{ matrix.target.vscode_target }} -o "ark-r-${{ inputs.version }}-${{ matrix.target.vscode_target }}.vsix"
101+
102+
- name: Upload vsix artifact
103+
uses: actions/upload-artifact@v4
104+
with:
105+
name: ark-r-${{ matrix.flavor }}-${{ matrix.target.vscode_target }}-vsix
106+
path: editors/vscode/ark-r-${{ inputs.version }}-${{ matrix.target.vscode_target }}.vsix

.github/workflows/release-windows.yml

Lines changed: 62 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,20 @@ jobs:
4444
cargo clean
4545
cargo build ${{ matrix.flavor == 'release' && '--release' || '' }} --target ${{ matrix.rust_target_prefix }}-pc-windows-msvc
4646
47-
- name: Upload unsigned executable for signing
47+
- name: Upload unsigned ark executable for signing
4848
uses: actions/upload-artifact@v4
4949
with:
5050
name: ark-${{ matrix.flavor }}-windows-${{ matrix.arch }}-unsigned
5151
path: target\${{ matrix.rust_target_prefix }}-pc-windows-msvc\${{ matrix.flavor }}\ark.exe
5252

53+
- name: Upload unsigned ark-lsp executable for signing
54+
uses: actions/upload-artifact@v4
55+
with:
56+
name: ark-lsp-${{ matrix.flavor }}-windows-${{ matrix.arch }}-unsigned
57+
path: target\${{ matrix.rust_target_prefix }}-pc-windows-msvc\${{ matrix.flavor }}\ark-lsp.exe
58+
5359
sign_windows:
54-
name: "Sign Windows Binaries"
60+
name: "Sign Windows ark Binaries"
5561
uses: posit-dev/posit-gh-actions/.github/workflows/sign-windows.yml@main
5662
needs: [build_windows]
5763
secrets: inherit
@@ -63,8 +69,21 @@ jobs:
6369
unsigned_artifact_name: ark-${{ matrix.flavor }}-windows-${{ matrix.arch }}-unsigned
6470
signed_artifact_name: ark-${{ matrix.flavor }}-windows-${{ matrix.arch }}-signed
6571

72+
sign_windows_ark_lsp:
73+
name: "Sign Windows ark-lsp Binaries"
74+
uses: posit-dev/posit-gh-actions/.github/workflows/sign-windows.yml@main
75+
needs: [build_windows]
76+
secrets: inherit
77+
strategy:
78+
matrix:
79+
arch: [x64, arm64]
80+
flavor: [debug, release]
81+
with:
82+
unsigned_artifact_name: ark-lsp-${{ matrix.flavor }}-windows-${{ matrix.arch }}-unsigned
83+
signed_artifact_name: ark-lsp-${{ matrix.flavor }}-windows-${{ matrix.arch }}-signed
84+
6685
repackage_signed_windows:
67-
name: Repackage Signed Windows Binaries
86+
name: Repackage Signed Windows ark Binaries
6887
runs-on: windows-latest
6988
needs: [sign_windows]
7089
timeout-minutes: 10
@@ -102,3 +121,43 @@ jobs:
102121
with:
103122
name: ark-${{ matrix.flavor }}-windows-${{ matrix.arch }}-archive
104123
path: ark-${{ inputs.version }}${{ env.DEBUG_FLAG }}-windows-${{ matrix.arch }}.zip
124+
125+
repackage_signed_windows_ark_lsp:
126+
name: Repackage Signed Windows ark-lsp Binaries
127+
runs-on: windows-latest
128+
needs: [sign_windows_ark_lsp]
129+
timeout-minutes: 10
130+
131+
env:
132+
DEBUG_FLAG: ${{ matrix.flavor == 'debug' && '-debug' || '' }}
133+
134+
strategy:
135+
matrix:
136+
arch: [x64, arm64]
137+
flavor: [debug, release]
138+
139+
steps:
140+
- name: Checkout sources
141+
uses: actions/checkout@v4
142+
143+
- name: Download signed executable
144+
uses: actions/download-artifact@v4
145+
with:
146+
name: ark-lsp-${{ matrix.flavor }}-windows-${{ matrix.arch }}-signed
147+
path: signed
148+
149+
- name: Create signed archive
150+
shell: pwsh
151+
run: |
152+
# Compress the signed ark-lsp to an archive
153+
$params = @{
154+
Path = "signed\ark-lsp.exe", "LICENSE", "crates\ark\NOTICE"
155+
DestinationPath = "ark-lsp-${{ inputs.version }}${{ env.DEBUG_FLAG }}-windows-${{ matrix.arch }}.zip"
156+
}
157+
Compress-Archive @params
158+
159+
- name: Upload signed archive
160+
uses: actions/upload-artifact@v4
161+
with:
162+
name: ark-lsp-${{ matrix.flavor }}-windows-${{ matrix.arch }}-archive
163+
path: ark-lsp-${{ inputs.version }}${{ env.DEBUG_FLAG }}-windows-${{ matrix.arch }}.zip

0 commit comments

Comments
 (0)