-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (93 loc) · 2.88 KB
/
vscode-ci.yml
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
name: VSCode extension CI
on:
workflow_dispatch:
push:
tags:
- "*.*.*"
env:
BIN_NAME: leptos-language-server
jobs:
build:
strategy:
matrix:
include:
- build: linux
platform: linux
os: ubuntu-latest
rust: stable
target: x86_64-unknown-linux-musl
arch: x64
npm_config_arch: x64
- build: macos
platform: darwin
os: macos-latest
rust: stable
target: x86_64-apple-darwin
arch: x64
npm_config_arch: x64
- build: macos
platform: darwin
os: macos-latest
rust: stable
target: aarch64-apple-darwin
arch: arm64
npm_config_arch: arm64
- build: win-msvc
platform: win32
os: windows-latest
rust: stable
npm_config_arch: x64
arch: x64
target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Install packages (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends xz-utils liblz4-tool musl-tools
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
override: true
target: ${{ matrix.target }}
- name: Build release binary
run: cargo build --target ${{ matrix.target }} --verbose --release
- uses: actions/setup-node@v2
with:
node-version: 14.x
- run: npm install
working-directory: editors/vscode/
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
npm_config_arch: ${{ matrix.npm_config_arch }}
- name: Copy lsp binary
shell: bash
run: |
staging="./editors/vscode/"
if [ "${{ matrix.os }}" = "windows-latest" ]; then
cp "target/${{ matrix.target }}/release/${{ env.BIN_NAME }}.exe" "$staging/"
mv "$staging/${{ env.BIN_NAME }}.exe" "$staging/${{ env.BIN_NAME }}"
else
cp "target/${{ matrix.target }}/release/${{ env.BIN_NAME }}" "$staging/"
fi
- shell: pwsh
run: echo "target=${{ matrix.platform }}-${{ matrix.arch }}" >> $env:GITHUB_ENV
- run: npx vsce package --pre-release --target ${{ env.target }}
working-directory: editors/vscode/
- uses: actions/upload-artifact@v2
with:
name: ${{ env.target }}
path: "editors/vscode/*.vsix"
publish:
runs-on: ubuntu-latest
needs: build
if: success() && startsWith( github.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v2
- run: npx vsce publish --pre-release --packagePath $(find . -iname *.vsix)
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}