Skip to content

Commit

Permalink
fix arm64 ci(tags only), disable ci for tags, use upx compress binary
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackhr-arch committed Jun 29, 2024
1 parent c37b4a5 commit 1d27326
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
nohup ./mihomo -d Example -f Example/basic_clash_config.yaml &
- name: Cache Target
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
uses: actions/cache@v4
with:
path: |
Expand Down Expand Up @@ -60,7 +61,7 @@ jobs:
retention-days: 5

build-linux-arm64:
if: false
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest

steps:
Expand All @@ -69,13 +70,17 @@ jobs:
fetch-depth: 0

- name: Set up Mihomo
if: false
# ignore as it's same as linux
run: |
wget --output-document mihomo.gz https://github.com/MetaCubeX/mihomo/releases/download/v1.18.4/mihomo-linux-amd64-v1.18.4.gz
gunzip mihomo.gz
chmod +x mihomo
nohup ./mihomo -d Example -f Example/basic_clash_config.yaml &
- name: Cache Target
if: false
# ignore as it's only built in a release
uses: actions/cache@v4
with:
path: |
Expand All @@ -90,29 +95,28 @@ jobs:
run: |
cd clashtui
rustup target add aarch64-unknown-linux-gnu
cargo install cargo-zigbuild
curl -OL https://ziglang.org/builds/zig-linux-x86_64-0.14.0-dev.121+ab4c461b7.tar.xz
tar -xf zig-linux-x86_64-0.14.0-dev.121+ab4c461b7.tar.xz
cargo install cross
cargo fetch
- name: Run tests
if: false
# ignore as it's same as linux
run: cd clashtui && cargo test --all --verbose

- name: Build
run: |
cd clashtui
export PATH=PATH:$PWD/zig-linux-x86_64-0.14.0-dev.121+ab4c461b7/
cargo zigbuild --target aarch64-unknown-linux-gnu.2.17 --all-features --verbose --locked
cargo zigbuild --target aarch64-unknown-linux-gnu.2.17 --all-features --release --locked
cross build --target=aarch64-unknown-linux-gnu --all-features --verbose --locked
cross build --target=aarch64-unknown-linux-gnu --all-features --release --locked
- name: Build Version
run: echo "Refer to build-linux"

- name: Pre Upload
run: |
mkdir artifacts
mv ./clashtui/target/release/clashtui ./artifacts/clashtui.arm64.release
mv ./clashtui/target/debug/clashtui ./artifacts/clashtui.arm64.debug
mv ./clashtui/target/aarch64-unknown-linux-gnu/release/clashtui ./artifacts/clashtui.arm64.release
mv ./clashtui/target/aarch64-unknown-linux-gnu/debug/clashtui ./artifacts/clashtui.arm64.debug
- name: upload artifacts
uses: actions/upload-artifact@v4
Expand All @@ -135,6 +139,7 @@ jobs:
mihomo-windows-amd64.exe -d Example -f Example/basic_clash_config.yaml &
- name: Cache Target
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
uses: actions/cache@v4
with:
path: |
Expand Down Expand Up @@ -174,12 +179,11 @@ jobs:
retention-days: 5

release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest

needs: [build-linux, build-linux-arm64, build-windows]

if: startsWith(github.ref, 'refs/tags/')

permissions:
contents: write

Expand All @@ -192,6 +196,7 @@ jobs:

- name: UPX compress
run: |
chmod +x ./artifacts/*
curl -OL https://github.com/upx/upx/releases/download/v4.2.4/upx-4.2.4-amd64_linux.tar.xz
tar -xf upx-4.2.4-amd64_linux.tar.xz
cp ./upx-4.2.4-amd64_linux/upx .
Expand Down

0 comments on commit 1d27326

Please sign in to comment.