-
Notifications
You must be signed in to change notification settings - Fork 0
133 lines (112 loc) · 3.76 KB
/
Copy pathvscode-sdif-release.yml
File metadata and controls
133 lines (112 loc) · 3.76 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
name: vscode-sdif-release
on:
push:
tags:
- "v*"
workflow_dispatch:
jobs:
build-lsp:
name: Build LSP (${{ matrix.name }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- name: linux-x64
os: ubuntu-latest
binary_name: sdif-lsp
src_path: sdif-lsp/target/release/sdif-lsp
- name: darwin-arm64
os: macos-latest
binary_name: sdif-lsp
src_path: sdif-lsp/target/release/sdif-lsp
- name: win32-x64
os: windows-latest
binary_name: sdif-lsp.exe
src_path: sdif-lsp/target/release/sdif-lsp.exe
steps:
- name: Checkout sdif-lsp
uses: actions/checkout@v4
with:
repository: sdif-format/sdif-lsp
path: sdif-lsp
- name: Checkout sdif-rs
uses: actions/checkout@v4
with:
repository: sdif-format/sdif-rs
path: sdif-rs
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Compile sdif-lsp
run: cargo build --release
working-directory: sdif-lsp
- name: Upload LSP artifact
uses: actions/upload-artifact@v4
with:
name: sdif-lsp-${{ matrix.name }}
path: ${{ matrix.src_path }}
release-extension:
name: Package VS Code Extension
needs: build-lsp
runs-on: ubuntu-latest
steps:
- name: Checkout vscode-sdif
uses: actions/checkout@v4
with:
path: vscode-sdif
- name: Checkout sdif-lsp
uses: actions/checkout@v4
with:
repository: sdif-format/sdif-lsp
path: sdif-lsp
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: vscode-sdif/package-lock.json
- name: Install dependencies
run: npm ci
working-directory: vscode-sdif
- name: Create dist directory
run: mkdir -p vscode-sdif/dist/lsp-binaries
- name: Download Linux x64 binary
uses: actions/download-artifact@v4
with:
name: sdif-lsp-linux-x64
path: vscode-sdif/dist/lsp-binaries/linux-x64
- name: Download macOS arm64 binary
uses: actions/download-artifact@v4
with:
name: sdif-lsp-darwin-arm64
path: vscode-sdif/dist/lsp-binaries/darwin-arm64
- name: Download Windows x64 binary
uses: actions/download-artifact@v4
with:
name: sdif-lsp-win32-x64
path: vscode-sdif/dist/lsp-binaries/win32-x64
- name: Ensure correct binary filenames
run: |
mv vscode-sdif/dist/lsp-binaries/linux-x64/sdif-lsp* vscode-sdif/dist/lsp-binaries/linux-x64/sdif-lsp || true
mv vscode-sdif/dist/lsp-binaries/darwin-arm64/sdif-lsp* vscode-sdif/dist/lsp-binaries/darwin-arm64/sdif-lsp || true
mv vscode-sdif/dist/lsp-binaries/win32-x64/sdif-lsp* vscode-sdif/dist/lsp-binaries/win32-x64/sdif-lsp.exe || true
- name: Compile extension
run: npm run compile
working-directory: vscode-sdif
- name: Assemble release binaries
run: npm run package:prepare -- --release
working-directory: vscode-sdif
- name: Run extension test suite
env:
SDIF_RELEASE_BUILD: 1
run: npm test
working-directory: vscode-sdif
- name: Package VSIX
env:
SDIF_RELEASE_BUILD: 1
run: npx vsce package --no-git-tag-version --out vscode-sdif-universal.vsix
working-directory: vscode-sdif
- name: Upload packaged VSIX
uses: actions/upload-artifact@v4
with:
name: vscode-sdif-vsix
path: vscode-sdif/vscode-sdif-universal.vsix