-
Notifications
You must be signed in to change notification settings - Fork 1
330 lines (312 loc) · 12.3 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
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
name: release
permissions:
contents: write
on:
schedule:
- cron: '0 18 * * *'
push:
branches: [ master, test ]
workflow_dispatch:
env:
llvm_ver: 17.0.6
jobs:
ubuntu: #{{{
runs-on: ubuntu-20.04
outputs:
winscp_ver: ${{ steps.winscp.outputs.version }}
putty_ver: ${{ steps.putty.outputs.version }}
mobaxterm_ver: ${{ steps.mobaxterm.outputs.version }}
# astyle_ver: ${{ steps.astyle.outputs.version }}
ahk_ver: ${{ steps.ahk.outputs.version }}
uctags_ver: ${{ steps.uctags.outputs.version }}
env:
WINSCP_VER: ${{ secrets.WINSCP_VER }}
steps:
-
name: Init Env
run: |
sudo apt-get update
mkdir -p ~/tools
echo $PATH
echo $(date)
# -
# name: Build make 3.82
# run: |
# wget -qOmake.tgz https://ftp.gnu.org/gnu/make/make-3.82.tar.gz
# tar xzvf make.tgz
# cd make-3.82
# sed -i 's/# if _GNU_GLOB_INTERFACE_VERSION == GLOB_INTERFACE_VERSION/# if _GNU_GLOB_INTERFACE_VERSION >= GLOB_INTERFACE_VERSION/' glob/glob.c
# ./configure --prefix=/opt/make_3.8.2
# make -j && make install
# cd /opt/make_3.8.2/bin
# ./make --version
# XZ_OPT=-9 tar cJvf ~/tools/make_3.8.2_linux_amd64.txz /opt/make_3.8.2
# -
# name: Build astyle #{{{
# id: astyle
# run: |
# echo "build astyle latest"
# git clone https://gitlab.com/saalen/astyle.git
# cd astyle
#
# ver=$(git describe --tags $(git rev-list --tags --max-count=1))
# git checkout $release
#
# cd AStyle
# mkdir out && cd $_
# cmake ../ -DCMAKE_EXE_LINKER_FLAGS_RELEASE="-static"
# make -j
#
# chmod a+x ./astyle
# ./astyle --version
# ldd ./astyle || true
# XZ_OPT=-9 tar cJvf ~/tools/astyle_linux_amd64.txz astyle
#
# echo "version=$ver" >> $GITHUB_OUTPUT
-
name: Get uctags #{{{
id: uctags
run: |
ver=$(curl -sv "https://github.com/universal-ctags/ctags-nightly-build/releases/latest" 2>&1 | grep -Po "(?<=releases/tag/).*?\+\w+")
date=$(echo $ver | grep -Po "^.*?(?=\+)")
echo $ver $date
wget -qOuctags.txz https://github.com/universal-ctags/ctags-nightly-build/releases/download/$ver/uctags-$date-linux-x86_64.release.tar.xz
tar xJvf uctags.txz
cd uctags-*/bin
ver=$(./ctags --version | grep -Po "(?<=Universal Ctags )\d+\.\d+\.\d+\(.*?\)")
echo "uctags version: $ver"
echo "version=$ver" >> $GITHUB_OUTPUT
XZ_OPT=-9 tar cJvf ~/tools/ctags_linux_amd64.txz ctags
-
name: Get autohotkey2 lsp #{{{
id: ahk
run: |
mkdir autohotkey2-lsp && cd $_
curl -L -o install.js https://raw.githubusercontent.com/thqby/vscode-autohotkey2-lsp/main/tools/install.js
node install.js
# ver=$(cat CHANGELOG.md | head -1 | grep -Po "(\d+\.){2}\d+")
# echo "version=$ver" >> $GITHUB_OUTPUT
cd ../
7z -mx9 a ~/tools/autohotkey2-lsp.zip ./autohotkey2-lsp
-
name: Get putty #{{{
id: putty
run: |
ver=$(curl -s "https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html" | grep -Po "(?<=latest release \()\d\.\d+" | head -1)
if [ -z "$ver" ]; then
ver=0.80
fi
mkdir -p putty && cd $_
wget -q https://the.earth.li/~sgtatham/putty/latest/w64/putty.exe
wget -q https://the.earth.li/~sgtatham/putty/latest/w64/pscp.exe
wget -q https://the.earth.li/~sgtatham/putty/latest/w64/psftp.exe
wget -q https://the.earth.li/~sgtatham/putty/latest/w64/puttytel.exe
wget -q https://the.earth.li/~sgtatham/putty/latest/w64/plink.exe
wget -q https://the.earth.li/~sgtatham/putty/latest/w64/pageant.exe
wget -q https://the.earth.li/~sgtatham/putty/latest/w64/puttygen.exe
7z -mx9 a ~/tools/putty_${ver}.zip ../putty
echo "version=$ver" >> $GITHUB_OUTPUT
-
name: Get MobaXterm
id: mobaxterm
run: |
moba_link=$(curl -s https://mobaxterm.mobatek.net/download-home-edition.html | grep -Po "https:.*?Portable.*?\.zip" | head -1)
ver=$(echo $moba_link | grep -Po "\d+\.\d+")
wget -q $moba_link
7z x MobaXterm*.zip -oMobaXterm
mv MobaXterm/MobaXterm* MobaXterm/MobaXterm.exe
7z -mx9 a ~/tools/MobaXterm_${ver}.zip ./MobaXterm
echo "version=$ver" >> $GITHUB_OUTPUT
-
name: Get winscp
id: winscp
run: |
ver=$(curl -s "https://github.com/winscp/winscp/tags" | grep -Po "(?<=tags/)(\d+\.){2}\d+(?=\.zip)" | head -1)
mkdir -p winscp && cd $_
echo "version=$ver" >> $GITHUB_OUTPUT
if [ "$WINSCP_VER" != "0" ]; then
ver=$WINSCP_VER
fi
wget -Owinscp.zip https://winscp.net/download/WinSCP-${ver}-Portable.zip
unzip winscp.zip && rm winscp.zip
7z -mx9 a ~/tools/winscp_${ver}.zip ../winscp
- uses: actions/upload-artifact@v4
with:
name: tools-multi
path: ~/tools
retention-days: 1
version: #{{{
runs-on: ubuntu-latest
outputs:
clangd: ${{ steps.clangd.outputs.version }}
ccls: ${{ steps.ccls.outputs.version }}
steps:
-
id: clangd
run: |
ver=$(curl -sv "https://github.com/llvm/llvm-project/releases/latest" 2>&1 | grep -P location: | grep -Po "\d+\.\d+\.\d+")
echo "version=$ver" >> $GITHUB_OUTPUT
-
id: ccls
run: |
git clone --depth=1 https://github.com/MaskRay/ccls
cd ccls
ver="master-$(git rev-parse --short HEAD)"
echo "version=$ver" >> $GITHUB_OUTPUT
# luals: #{{{
# runs-on: ubuntu-latest
# outputs:
# version: ${{ steps.build.outputs.version }}
# steps:
# - name: Build
# id: build
# run: |
# mkdir -p ~/tools
#
# ver=$(curl -sv "https://github.com/ninja-build/ninja/releases/latest" 2>&1 | grep -P location: | grep -Po "(\d+\.){2}\d+")
# wget -qOninja.zip https://github.com/ninja-build/ninja/releases/download/v${ver}/ninja-linux.zip
# 7z x ninja.zip
# sudo mv ninja /usr/local/bin
# ninja --version
#
# git clone https://github.com/LuaLS/lua-language-server --recurse-submodules
# # cd lua-language-server/3rd/EmmyLuaCodeStyle
# # git checkout master
# # cd ../../
# # git add .
# cd lua-language-server
# ./make.sh
#
# chmod +x ./bin/*
# ver=$(./bin/lua-language-server --version)
# ver="${ver}-$(git rev-parse --short HEAD)"
# echo "version=$ver" >> $GITHUB_OUTPUT
#
# mkdir lua-language-server
# cp -r main.lua debugger.lua LICENSE changelog.md locale meta script bin ./lua-language-server/
# XZ_OPT=-9 tar cJf ~/tools/lua-language-server-linux-x64.txz ./lua-language-server
# - uses: actions/upload-artifact@v4
# with:
# name: tools-luals
# path: ~/tools
# retention-days: 1
tig: #{{{
runs-on: ubuntu-20.04
outputs:
version: ${{ steps.build.outputs.version }}
steps:
- name: Build
id: build
run: |
sudo apt-get update
sudo apt install -y automake
mkdir -p ~/tools
echo "install ncursesw 6.3"
# https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.3.tar.gz
wget -qOncurses.tgz https://mirrors.aliyun.com/gnu/ncurses/ncurses-6.3.tar.gz
tar xzf ncurses.tgz
cd ncurses-*
./configure --prefix=/usr/local \
--enable-widec --enable-pc-files --with-terminfo-dirs='/etc/terminfo:/lib/terminfo:/usr/share/terminfo' \
--without-debug --without-tests
make -j && sudo make install
cd -
echo "install readline 8.1"
# https://ftp.gnu.org/gnu/readline/readline-8.1.tar.gz
wget -qOreadline.tgz https://mirrors.aliyun.com/gnu/readline/readline-8.1.tar.gz
tar xzf readline.tgz
cd readline-*
./configure --prefix=/usr/local
make -j && sudo make install
cd -
ver=$(curl -sv "https://github.com/PCRE2Project/pcre2/releases/latest" 2>&1 | grep -P location: | grep -Po "\d+\.\d+")
echo "install pcre2 $ver"
wget -qOpcre2.tgz https://github.com/PCRE2Project/pcre2/releases/download/pcre2-$ver/pcre2-$ver.tar.gz
tar xzf pcre2.tgz
cd pcre2-*
./configure --prefix=/usr/local \
--build=x86_64-linux-gnu --sysconfdir=/etc --localstatedir=/var \
--disable-option-checking --disable-silent-rules \
--disable-maintainer-mode --disable-dependency-tracking --enable-pcre2-16 --enable-pcre2-32 \
--disable-pcre2grep-callout
make -j && sudo make install
cd -
echo "build tig latest release"
ver=$(curl -sv "https://github.com/jonas/tig/releases/latest" 2>&1 | grep -P location: | grep -Po "(\d+\.){2}\d+")
#ver=2.5.4
wget -qOtig.tgz https://github.com/jonas/tig/releases/download/tig-$ver/tig-$ver.tar.gz
tar xzf tig.tgz
cd tig-*
./autogen.sh
./configure LIBS=-pthread LDFLAGS="-static -L/usr/local/lib" CPPFLAGS="-I/usr/local/include"
make -j
cp src/tig .
chmod a+x ./tig
./tig --version
ldd ./tig || true
XZ_OPT=-9 tar cJvf ~/tools/tig_linux_amd64.txz tig
echo "version=$ver" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v4
with:
name: tools-tig
path: ~/tools
retention-days: 1
atuin:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: msys2/setup-msys2@v2
with:
update: true
msystem: UCRT64
- run: pacman --noconfirm -Syu p7zip mingw-w64-ucrt-x86_64-rust mingw-w64-ucrt-x86_64-protobuf # protobuf is needed by atuin
- uses: Swatinem/rust-cache@v2
- run: |
cargo install atuin
7z -mx9 a /c/atuin_windows_amd64.zip /c/Users/runneradmin/.cargo/bin/atuin.exe
- name: 'Upload Artifact'
uses: actions/upload-artifact@v4
with:
name: tools-atuin
path: c:\atuin_windows_amd64.zip
publish: #{{{
needs: [ubuntu, version, tig, atuin]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: tools
pattern: tools-*
merge-multiple: true
- run: ls -la tools
- name: Publish
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITEE_KEY: ${{ secrets.GITEE_KEY }}
run: |
{
echo "* clangd ${{ needs.version.outputs.clangd }} last release with rpath lib"
echo "* clang-format ${{ needs.version.outputs.clangd }} last release static"
# echo "* ccls ${{ needs.version.outputs.ccls }} linux (build with llvm ${{ env.llvm_ver }})"
# echo "* ccls ${{ needs.version.outputs.cls }} windows(build with llvm ${{ env.llvm_ver }})"
echo "* uctags ${{ needs.ubuntu.outputs.uctags_ver }} static"
# echo "* luals ${{ needs.luals.outputs.version }}"
# echo "* autohotkey2-lsp ${{ needs.ubuntu.outputs.ahk_ver }}"
echo "* autohotkey2-lsp latest"
echo "* tig ${{ needs.tig.outputs.version }} static"
echo "* atuin windows last release"
# echo "* astyle ${{ needs.ubuntu.outputs.astyle_ver }} static"
# echo "* make 3.8.2"
# echo "* putty ${{ needs.ubuntu.outputs.putty_ver }}"
# echo "* MobaXterm ${{ needs.ubuntu.outputs.mobaxterm_ver }}"
# echo "* winscp ${{ needs.ubuntu.outputs.winscp_ver }}"
} | tee /tmp/note.md
#upload to draft, publish after clangd build end
tag_name=release_temp
gh release delete $tag_name -y || true
gh release create $tag_name -t "tools" -F "/tmp/note.md" -d --target $GITHUB_SHA
sleep 5
gh release upload $tag_name --clobber ./tools/*