Repository navigation
179 lines (174 loc) · 6.25 KB
/
Copy pathrelease-vs-code.yaml
File metadata and controls
179 lines (174 loc) · 6.25 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
on:
push:
tags: ["duper-vs-code@*.*.*"]
permissions:
contents: read
env:
RUST_VERSION: "1.94.0"
CARGO_INCREMENTAL: "0"
CARGO_PROFILE_TEST_DEBUG: "0"
NODE_VERSION: "22"
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- runner: ubuntu-24.04
target: x86_64-unknown-linux-gnu
vscode-target: linux-x64
os: linux
- runner: ubuntu-24.04
target: aarch64-unknown-linux-gnu
vscode-target: linux-arm64
os: linux
- runner: ubuntu-24.04
target: x86_64-unknown-linux-musl
vscode-target: alpine-x64
os: linux
- runner: ubuntu-24.04
target: aarch64-unknown-linux-musl
vscode-target: alpine-arm64
os: linux
- runner: windows-latest
target: x86_64-pc-windows-msvc
vscode-target: win32-x64
os: windows
- runner: windows-latest
target: aarch64-pc-windows-msvc
vscode-target: win32-arm64
os: windows
- runner: macos-15
target: x86_64-apple-darwin
vscode-target: darwin-x64
os: macos
- runner: macos-15
target: aarch64-apple-darwin
vscode-target: darwin-arm64
os: macos
name: Build and package (${{ matrix.vscode-target }})
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: true
- name: Fetch MSRV and add target
run: |
rustup toolchain install ${RUST_VERSION}
rustup override set ${RUST_VERSION}
rustup target add ${{ matrix.target }}
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
- name: Install Zig
if: matrix.runner == 'ubuntu-24.04'
uses: mlugg/setup-zig@8d6198c65fb0feaa111df26e6b467fea8345e46f # v2.0.5
with:
version: latest
- name: Install cargo-zigbuild (Linux)
if: matrix.runner == 'ubuntu-24.04'
uses: taiki-e/install-action@a24ba45235ed716ff76646268742990dc9458860 # v2.62.42
with:
tool: cargo-zigbuild
- name: Install lld (macOS)
if: matrix.os == 'macos'
run: |
brew install lld
- name: Install lld (Windows)
if: matrix.os == 'windows'
run: |
choco install llvm
- name: Build with cargo-zigbuild (Linux)
if: matrix.runner == 'ubuntu-24.04'
run: |
cargo zigbuild --locked --all-features --release --target ${{ matrix.target }} --manifest-path duper_lsp/Cargo.toml
- name: Build with cargo (macOS / Windows)
if: matrix.runner != 'ubuntu-24.04'
run: |
cargo build --locked --all-features --release --target ${{ matrix.target }} --manifest-path duper_lsp/Cargo.toml
- name: Copy binary to extension (Linux / macOS)
if: matrix.os != 'windows'
run: |
cp target/${{ matrix.target }}/release/duper_lsp duper-vs-code/duper_lsp
mkdir dist
- name: Copy binary to extension (Windows)
if: matrix.os == 'windows'
shell: bash
run: |
cp target/${{ matrix.target }}/release/duper_lsp.exe duper-vs-code/duper_lsp.exe
mkdir dist
- name: Setup Node
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: ${{ env.NODE_VERSION }}
- name: Build extension
working-directory: duper-vs-code
run: |
npm ci
npm run build
npx vsce package --out "../dist/duper-vs-code-${{ matrix.vscode-target }}.vsix" --target ${{ matrix.vscode-target }}
- name: Upload artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: dist-${{ matrix.vscode-target }}
path: dist
vscode:
name: Release VSCode extension
runs-on: ubuntu-24.04
environment: vsce
needs: build
steps:
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: true
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
name: dist-linux-x64
path: dist
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
name: dist-linux-arm64
path: dist
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
name: dist-alpine-x64
path: dist
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
name: dist-alpine-arm64
path: dist
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
name: dist-win32-x64
path: dist
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
name: dist-win32-arm64
path: dist
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
name: dist-darwin-x64
path: dist
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
name: dist-darwin-arm64
path: dist
- run: |
ls -al ./dist
- name: Setup Node
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install dependencies
working-directory: duper-vs-code
run: |
npm ci
- name: Publish to Visual Studio Marketplace
working-directory: duper-vs-code
run: |
npx vsce publish --pat ${{ secrets.VSCE_TOKEN }} --packagePath ../dist/duper-vs-code-*.vsix
- name: Publish to Open VSX
working-directory: duper-vs-code
run: |
npx ovsx publish --pat ${{ secrets.OVSX_TOKEN }} --packagePath ../dist/duper-vs-code-*.vsix