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: Publish Code Extensions
on:
workflow_call:
inputs:
release-tag:
description: "If set, download binaries from this GitHub release tag instead of same-run workflow artifacts"
type: string
required: false
default: ""
workflow_dispatch:
inputs:
release-tag:
description: "Release tag to download binaries from"
type: string
required: true
concurrency:
group: ${{ github.workflow }}-${{ inputs.release-tag || github.ref }}
cancel-in-progress: true
jobs:
publish-platform:
name: Publish ${{ matrix.vsce_target }}
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- vsce_target: win32-x64
rust_target: x86_64-pc-windows-msvc
binary: panache.exe
- vsce_target: win32-arm64
rust_target: aarch64-pc-windows-msvc
binary: panache.exe
- vsce_target: linux-x64
rust_target: x86_64-unknown-linux-gnu
binary: panache
- vsce_target: linux-arm64
rust_target: aarch64-unknown-linux-gnu
binary: panache
- vsce_target: alpine-x64
rust_target: x86_64-unknown-linux-musl
binary: panache
- vsce_target: alpine-arm64
rust_target: aarch64-unknown-linux-musl
binary: panache
- vsce_target: darwin-x64
rust_target: x86_64-apple-darwin
binary: panache
- vsce_target: darwin-arm64
rust_target: aarch64-apple-darwin
binary: panache
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 20
cache: npm
cache-dependency-path: editors/code/package-lock.json
- name: Install dependencies
working-directory: editors/code
run: npm ci
- name: Download binary (workflow artifact)
if: ${{ inputs.release-tag == '' }}
uses: actions/download-artifact@v8
with:
name: panache-binary-${{ matrix.rust_target }}
path: editors/code/server
- name: Download binary (release asset)
if: ${{ inputs.release-tag != '' }}
shell: bash
run: |
set -euo pipefail
mkdir -p editors/code/server
cd editors/code/server
if [[ "${{ matrix.binary }}" == *.exe ]]; then
gh release download "${{ inputs.release-tag }}" -p "panache-${{ matrix.rust_target }}.zip" --repo "${{ github.repository }}"
unzip -j "panache-${{ matrix.rust_target }}.zip" "${{ matrix.binary }}"
rm "panache-${{ matrix.rust_target }}.zip"
else
gh release download "${{ inputs.release-tag }}" -p "panache-${{ matrix.rust_target }}.tar.gz" --repo "${{ github.repository }}"
tar -xzf "panache-${{ matrix.rust_target }}.tar.gz" "${{ matrix.binary }}"
rm "panache-${{ matrix.rust_target }}.tar.gz"
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Mark binary executable
run: chmod +x editors/code/server/${{ matrix.binary }}
- name: Compile extension
working-directory: editors/code
run: npm run compile
- name: Publish to Open VSX Registry
uses: HaaLeo/publish-vscode-extension@v2
with:
pat: ${{ secrets.OVSX_PAT }}
packagePath: editors/code
target: ${{ matrix.vsce_target }}
- name: Publish to Visual Studio Marketplace
uses: HaaLeo/publish-vscode-extension@v2
with:
pat: ${{ secrets.VSCE_PAT }}
registryUrl: https://marketplace.visualstudio.com
packagePath: editors/code
target: ${{ matrix.vsce_target }}