-
Notifications
You must be signed in to change notification settings - Fork 134
145 lines (124 loc) · 4.19 KB
/
release.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
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
name: release
on:
workflow_dispatch:
push:
branches:
- 'release/**'
env:
FETCH_DEPTH: 0 # pull in the tags for the version string
LLM_LS_VERSION: 0.5.3
jobs:
package:
strategy:
matrix:
include:
- target: x86_64-pc-windows-msvc
code-target: win32-x64
# - os: windows-latest
# target: aarch64-pc-windows-msvc
# code-target: win32-arm64
- target: x86_64-unknown-linux-gnu
code-target: linux-x64
- target: aarch64-unknown-linux-gnu
code-target: linux-arm64
- target: arm-unknown-linux-gnueabihf
code-target: linux-armhf
- target: x86_64-apple-darwin
code-target: darwin-x64
- target: aarch64-apple-darwin
code-target: darwin-arm64
- target: x86_64-unknown-linux-musl
code-target: alpine-x64
env:
LLM_LS_TARGET: ${{ matrix.target }}
name: package (${{ matrix.target }})
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: ${{ env.FETCH_DEPTH }}
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- uses: robinraju/[email protected]
with:
repository: "huggingface/llm-ls"
tag: ${{ env.LLM_LS_VERSION }}
fileName: "llm-ls-${{ matrix.target }}.gz"
- name: Unzip llm-ls
if: contains(matrix.code-target, 'win32')
run: mkdir server && gunzip -c llm-ls-${{ matrix.target }}.gz > server/llm-ls.exe && chmod +x server/llm-ls.exe
- name: Unzip llm-ls
if: ${{ !contains(matrix.code-target, 'win32') }}
run: mkdir server && gunzip -c llm-ls-${{ matrix.target }}.gz > server/llm-ls && chmod +x server/llm-ls
- name: Install dependencies
run: npm ci
- name: Package Extension
run: npx vsce package -o "./llm-ls-${{ matrix.code-target }}.vsix" --target ${{ matrix.code-target }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: pkg-${{ matrix.target }}
path: ./llm-ls-${{ matrix.code-target }}.vsix
publish:
name: publish
runs-on: ubuntu-latest
needs: ["package"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: ${{ env.FETCH_DEPTH }}
- name: Install Nodejs
uses: actions/setup-node@v4
with:
node-version: 20
- run: echo "HEAD_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV
- run: 'echo "HEAD_SHA: $HEAD_SHA"'
- name: Split branch name
env:
BRANCH: ${{ github.ref_name }}
id: split
run: echo "tag=${BRANCH##*/}" >> $GITHUB_OUTPUT
- uses: actions/download-artifact@v4
with:
name: pkg-aarch64-apple-darwin
path: pkg
- uses: actions/download-artifact@v4
with:
name: pkg-x86_64-apple-darwin
path: pkg
- uses: actions/download-artifact@v4
with:
name: pkg-x86_64-unknown-linux-gnu
path: pkg
- uses: actions/download-artifact@v4
with:
name: pkg-x86_64-unknown-linux-musl
path: pkg
- uses: actions/download-artifact@v4
with:
name: pkg-aarch64-unknown-linux-gnu
path: pkg
- uses: actions/download-artifact@v4
with:
name: pkg-arm-unknown-linux-gnueabihf
path: pkg
- uses: actions/download-artifact@v4
with:
name: pkg-x86_64-pc-windows-msvc
path: pkg
# - uses: actions/download-artifact@v4
# with:
# name: pkg-aarch64-pc-windows-msvc
# path: pkg
- run: ls -al ./pkg
- run: npm ci
- name: Publish Extension (Code Marketplace, release)
# token from https://dev.azure.com/huggingface/
run: npx vsce publish --pat ${{ secrets.MARKETPLACE_TOKEN }} --packagePath ./pkg/llm-ls-*.vsix
- name: Publish Extension (OpenVSX, release)
run: npx ovsx publish --pat ${{ secrets.OPENVSX_TOKEN }} --packagePath ./pkg/llm-ls-*.vsix
timeout-minutes: 2