Skip to content

release

release #1320

Workflow file for this run

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.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
clangd: #{{{
runs-on: ubuntu-latest
outputs:
version: ${{ steps.build.outputs.version }}
steps:
- name: Check version
id: build
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
ccls: #{{{
runs-on: ubuntu-latest
outputs:
version: ${{ steps.build.outputs.version }}
steps:
- name: Check version
id: build
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
publish: #{{{
needs: [ubuntu, clangd, ccls, luals, tig]
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.clangd.outputs.version }} last release with rpath lib"
echo "* clang-format ${{ needs.clangd.outputs.version }} last release static"
echo "* ccls ${{ needs.ccls.outputs.version }} linux (build with llvm ${{ env.llvm_ver }})"
echo "* ccls ${{ needs.ccls.outputs.version }} 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 "* tig ${{ needs.tig.outputs.version }} static"
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/*