Skip to content

Commit

Permalink
Update build scripts
Browse files Browse the repository at this point in the history
Use GHA for packaging release.
  • Loading branch information
tindy2013 committed Aug 5, 2022
1 parent 8bcd7a3 commit b37f6ae
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 5 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Add commit id into version
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
run: SHA=$(git rev-parse --short HEAD) && sed -i 's/\(v[0-9]\.[0-9]\.[0-9]\)/\1-'"$SHA"'/' src/version.h
- name: Build
run: |
docker run -v $GITHUB_WORKSPACE:/root/workdir -e TRAVIS_BRANCH=action -e TRAVIS_TAG=action multiarch/alpine:x86-latest-stable /bin/sh -c "apk add bash git && cd /root/workdir && bash scripts/build.alpine.release.sh"
Expand All @@ -19,12 +22,24 @@ jobs:
with:
name: stairspeedtest_reborn_linux32
path: stairspeedtest/
- name: Package Release
if: startsWith(github.ref, 'refs/tags/')
run: tar czf stairspeedtest_reborn_linux32.tar.gz stairspeedtest
- name: Draft Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: stairspeedtest_reborn_linux32.tar.gz
draft: true

linux64_build:
name: Linux x86_64 Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Add commit id into version
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
run: SHA=$(git rev-parse --short HEAD) && sed -i 's/\(v[0-9]\.[0-9]\.[0-9]\)/\1-'"$SHA"'/' src/version.h
- name: Build
run: |
docker run -v $GITHUB_WORKSPACE:/root/workdir -e TRAVIS_BRANCH=action -e TRAVIS_TAG=action multiarch/alpine:amd64-latest-stable /bin/sh -c "apk add bash git && cd /root/workdir && bash scripts/build.alpine.release.sh"
Expand All @@ -33,12 +48,24 @@ jobs:
with:
name: stairspeedtest_reborn_linux64
path: stairspeedtest/
- name: Package Release
if: startsWith(github.ref, 'refs/tags/')
run: tar czf stairspeedtest_reborn_linux64.tar.gz stairspeedtest
- name: Draft Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: stairspeedtest_reborn_linux64.tar.gz
draft: true

macos_build:
name: macOS Build
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Add commit id into version
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
run: SHA=$(git rev-parse --short HEAD) && sed -i 's/\(v[0-9]\.[0-9]\.[0-9]\)/\1-'"$SHA"'/' src/version.h
- name: Build
run: |
bash scripts/build.macos.release.sh
Expand All @@ -49,6 +76,15 @@ jobs:
with:
name: stairspeedtest_reborn_darwin64
path: stairspeedtest/
- name: Package Release
if: startsWith(github.ref, 'refs/tags/')
run: tar czf stairspeedtest_reborn_darwin64.tar.gz stairspeedtest
- name: Draft Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: stairspeedtest_reborn_darwin64.tar.gz
draft: true

windows64_build:
name: Windows x86_64 Build
Expand All @@ -58,6 +94,9 @@ jobs:
shell: msys2 {0}
steps:
- uses: actions/checkout@v2
- name: Add commit id into version
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
run: SHA=$(git rev-parse --short HEAD) && sed -i 's/\(v[0-9]\.[0-9]\.[0-9]\)/\1-'"$SHA"'/' src/version.h
- uses: msys2/setup-msys2@v2
with:
update: true
Expand Down Expand Up @@ -95,6 +134,16 @@ jobs:
with:
name: stairspeedtest_reborn_win64
path: stairspeedtest/
- name: Package Release
if: startsWith(github.ref, 'refs/tags/')
run: tar czf stairspeedtest_reborn_win64.tar.gz stairspeedtest
- name: Draft Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: stairspeedtest_reborn_win64.tar.gz
draft: true

windows32_build:
name: Windows x86 Build
runs-on: windows-latest
Expand All @@ -103,6 +152,9 @@ jobs:
shell: msys2 {0}
steps:
- uses: actions/checkout@v2
- name: Add commit id into version
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
run: SHA=$(git rev-parse --short HEAD) && sed -i 's/\(v[0-9]\.[0-9]\.[0-9]\)/\1-'"$SHA"'/' src/version.h
- uses: msys2/setup-msys2@v2
with:
update: true
Expand Down Expand Up @@ -141,3 +193,12 @@ jobs:
with:
name: stairspeedtest_reborn_win32
path: stairspeedtest/
- name: Package Release
if: startsWith(github.ref, 'refs/tags/')
run: tar czf stairspeedtest_reborn_win32.tar.gz stairspeedtest
- name: Draft Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: stairspeedtest_reborn_win32.tar.gz
draft: true
3 changes: 2 additions & 1 deletion scripts/build.alpine.clients.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,12 @@ if [[ "$ARCH" = "x86_64" ]];then
curl -LO https://github.com/joewalnes/websocketd/releases/download/v0.3.1/websocketd-0.3.1-linux_386.zip
curl -LO https://github.com/shadowsocks/v2ray-plugin/releases/download/v1.3.1/v2ray-plugin-linux-386-v1.3.1.tar.gz
else
curl -LO https://github.com/joewalnes/websocketd/releases/download/v0.3.1/websocketd-0.3.1-linux_arm.zip
if [[ "$ARCH" = "aarch64" ]];then
curl -LO https://github.com/joewalnes/websocketd/releases/download/v0.4.1/websocketd-0.4.1-linux_arm64.zip
curl -LO https://github.com/v2fly/v2ray-core/releases/latest/download/v2ray-linux-arm64-v8a.zip
curl -LO https://github.com/shadowsocks/v2ray-plugin/releases/download/v1.3.1/v2ray-plugin-linux-arm64-v1.3.1.tar.gz
else if [[ "$ARCH" = "armhf" ]];then
curl -LO https://github.com/joewalnes/websocketd/releases/download/v0.4.1/websocketd-0.4.1-linux_arm.zip
curl -LO https://github.com/v2fly/v2ray-core/releases/latest/download/v2ray-linux-arm32-v7a.zip
curl -LO https://github.com/shadowsocks/v2ray-plugin/releases/download/v1.3.1/v2ray-plugin-linux-arm-v1.3.1.tar.gz
fi
Expand Down
4 changes: 2 additions & 2 deletions scripts/build.macos.clients.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ curl -LO https://github.com/trojan-gfw/trojan/releases/download/v1.16.0/trojan-1
unzip trojan*.zip trojan/trojan
mv trojan/trojan base/tools/clients/

curl -LO https://github.com/joewalnes/websocketd/releases/download/v0.3.0/websocketd-0.3.0-darwin_amd64.zip
unzip websocketd-0.3.0-darwin_amd64.zip websocketd
curl -LO https://github.com/joewalnes/websocketd/releases/download/v0.4.1/websocketd-0.4.1-darwin_amd64.zip
unzip websocketd-0.4.1-darwin_amd64.zip websocketd
mv websocketd base/tools/gui/

curl -LO https://github.com/shadowsocks/v2ray-plugin/releases/download/v1.3.1/v2ray-plugin-darwin-amd64-v1.3.1.tar.gz
Expand Down
4 changes: 2 additions & 2 deletions scripts/build.windows.clients.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@ cd ..

if [[ "$MSYSTEM" = "MINGW64" ]];then
curl -LO https://github.com/v2fly/v2ray-core/releases/latest/download/v2ray-windows-64.zip
curl -LO https://github.com/joewalnes/websocketd/releases/download/v0.3.1/websocketd-0.3.1-windows_amd64.zip
curl -LO https://github.com/joewalnes/websocketd/releases/download/v0.4.1/websocketd-0.4.1-windows_amd64.zip
curl -LO https://github.com/shadowsocks/v2ray-plugin/releases/download/v1.3.1/v2ray-plugin-windows-amd64-v1.3.1.tar.gz
fi
if [[ "$MSYSTEM" = "MINGW32" ]];then
curl -LO https://github.com/v2fly/v2ray-core/releases/latest/download/v2ray-windows-32.zip
curl -LO https://github.com/joewalnes/websocketd/releases/download/v0.3.1/websocketd-0.3.1-windows_386.zip
curl -LO https://github.com/joewalnes/websocketd/releases/download/v0.4.1/websocketd-0.4.1-windows_386.zip
curl -LO https://github.com/shadowsocks/v2ray-plugin/releases/download/v1.3.1/v2ray-plugin-windows-386-v1.3.1.tar.gz
fi

Expand Down

0 comments on commit b37f6ae

Please sign in to comment.