Skip to content

Commit b9a047f

Browse files
committed
[Git] Modify the extension packaging per platform
1 parent df94ea9 commit b9a047f

2 files changed

Lines changed: 33 additions & 17 deletions

File tree

‎.github/workflows/main.yml‎

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,22 @@ jobs:
182182
needs: [build-release]
183183
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
184184
runs-on: ubuntu-latest
185+
strategy:
186+
fail-fast: false
187+
matrix:
188+
include:
189+
- target: linux-x64
190+
artifact: log2src-${{ github.ref_name }}-linux-x64
191+
vsce-target: linux-x64
192+
- target: darwin-x64
193+
artifact: log2src-${{ github.ref_name }}-macos-x64
194+
vsce-target: darwin-x64
195+
- target: darwin-arm64
196+
artifact: log2src-${{ github.ref_name }}-macos-arm64
197+
vsce-target: darwin-arm64
198+
- target: win32-x64
199+
artifact: log2src-${{ github.ref_name }}-windows-x64
200+
vsce-target: win32-x64
185201

186202
steps:
187203
- name: Checkout repository
@@ -204,13 +220,15 @@ jobs:
204220
with:
205221
path: artifacts
206222

207-
- name: Extract binaries for VS Code extension
223+
- name: Extract binary for VS Code extension target
208224
run: |
209-
mkdir -p editors/code/bin/{linux-x64,darwin-x64,darwin-arm64,win32-x64}
210-
tar -xzf artifacts/log2src-${{ github.ref_name }}-linux-x64/log2src-${{ github.ref_name }}-linux-x64.tar.gz -C editors/code/bin/linux-x64
211-
tar -xzf artifacts/log2src-${{ github.ref_name }}-macos-x64/log2src-${{ github.ref_name }}-macos-x64.tar.gz -C editors/code/bin/darwin-x64
212-
tar -xzf artifacts/log2src-${{ github.ref_name }}-macos-arm64/log2src-${{ github.ref_name }}-macos-arm64.tar.gz -C editors/code/bin/darwin-arm64
213-
unzip -o artifacts/log2src-${{ github.ref_name }}-windows-x64/log2src-${{ github.ref_name }}-windows-x64.zip -d editors/code/bin/win-x64
225+
rm -rf editors/code/bin
226+
mkdir -p "editors/code/bin/${{ matrix.target }}"
227+
if [[ "${{ matrix.target }}" == "win32-x64" ]]; then
228+
unzip -o "artifacts/${{ matrix.artifact }}/${{ matrix.artifact }}.zip" -d "editors/code/bin/${{ matrix.target }}"
229+
else
230+
tar -xzf "artifacts/${{ matrix.artifact }}/${{ matrix.artifact }}.tar.gz" -C "editors/code/bin/${{ matrix.target }}"
231+
fi
214232
215233
- name: Cache VS Code test runtime
216234
uses: actions/cache@v4
@@ -246,17 +264,16 @@ jobs:
246264
run: |
247265
REF_NAME="${{ github.ref_name }}"
248266
VERSION=${REF_NAME#v}
249-
# Update version in package.json
250267
jq '.version = "'$VERSION'"' package.json > package.json.new
251268
mv package.json.new package.json
252-
pnpm vsce package --no-dependencies
269+
pnpm vsce package --no-dependencies --target ${{ matrix.vsce-target }}
253270
254271
- name: Upload VS Code extension
255272
if: startsWith(github.ref, 'refs/tags/')
256273
uses: actions/upload-artifact@v4
257274
with:
258-
name: log2src-ext-${{ github.ref_name }}.vsix
259-
path: editors/code/log2src-ext-*.vsix
275+
name: log2src-ext-${{ github.ref_name }}-${{ matrix.target }}.vsix
276+
path: editors/code/*.vsix
260277
if-no-files-found: error
261278

262279
release:

‎docs/Tasks.md‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33

44
## Extension
55

6-
- [ ] Bump `editors/code/package.json` version to 0.1.0 and add `repository.directory`, `keywords`, `icon` field
7-
- [ ] Verify `engines.vscode` vs `@types/vscode` API compatibility
8-
- [ ] Write real 0.1.0 CHANGELOG entry (replace placeholder)
9-
- [ ] Exclude `out/test/**` in `editors/code/.vscodeignore`
10-
- [ ] Update CI (`vscode-extension` job) to build per-platform vsix via `vsce package --target <platform>` instead of one universal vsix
11-
- [ ] Document manual publish runbook (publisher/PAT setup, `vsce login`, `vsce publish --target` per platform)
12-
- [ ] Source an extension icon (manual, blocking first publish)
6+
- [x] Bump `editors/code/package.json` version to 0.1.0 and add `repository.directory`, `keywords`, `icon` field
7+
- [x] Verify `engines.vscode` vs `@types/vscode` API compatibility
8+
- [x] Write real 0.1.0 CHANGELOG entry (replace placeholder)
9+
- [x] Exclude `out/test/**` in `editors/code/.vscodeignore`
10+
- [x] Update CI (`vscode-extension` job) to build per-platform vsix via `vsce package --target <platform>` instead of one universal vsix
11+
- [x] Source an extension icon (manual, blocking first publish)
1312
- [ ] Register Marketplace publisher `ttiimm` + generate PAT (manual, external)
1413

1514
- [ ] Work with non .log extension (.json, etc).

0 commit comments

Comments
 (0)