Skip to content

Commit

Permalink
fix artifacts build
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackhr-arch committed Aug 30, 2024
1 parent 0c77be9 commit 99c654c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
27 changes: 16 additions & 11 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
with:
fetch-depth: 0

- name: Cache Target
- name: Cache
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
uses: actions/cache@v4
with:
Expand All @@ -32,11 +32,24 @@ jobs:
ci-${{ runner.os }}-${{ hashFiles('./Cargo.lock') }}
ci-${{ runner.os }}-
- name: Download Dependencies
- name: Test
run: |
cargo install --debug cargo-make
cargo make ci
- name: Build
run: cargo make release

- 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 .
./upx artifacts/*.release
./upx artifacts/*.debug
./upx artifacts/*.exe
- name: upload artifacts
uses: actions/upload-artifact@v4
with:
Expand All @@ -45,8 +58,8 @@ jobs:
retention-days: 5

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

needs: build

Expand All @@ -60,14 +73,6 @@ jobs:
merge-multiple: true
path: ./artifacts

- 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 .
./upx ./artifacts/*
- name: Create Release
uses: softprops/action-gh-release@v2
with:
Expand Down
5 changes: 3 additions & 2 deletions Makefile.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

[env]
# use for build arm64 in docker
CROSS_CONTAINER_IN_CONTAINER = true
# CROSS_CONTAINER_IN_CONTAINER = true


[tasks.ci]
Expand All @@ -12,7 +12,7 @@ script = ["rm mihomo", "rm Doc/clash_test/cache.db"]
script = '''
curl --output mihomo.zip -L https://github.com/MetaCubeX/mihomo/releases/download/v1.18.4/mihomo-windows-amd64-v1.18.4.zip
7z x mihomo.zip
mihomo-windows-amd64.exe -d Doc/clash_test -f Doc/clash_test/config.yaml &
Start-Progress {} mihomo-windows-amd64.exe -d Doc/clash_test -f Doc/clash_test/config.yaml }
'''
[tasks.setup_mihomo.linux]
script = '''
Expand Down Expand Up @@ -44,6 +44,7 @@ script = '''

[tasks.clear-artifacts]
script_runner = "@shell"
ignore_errors = true
script = ["rm -r artifacts"]

[tasks.build_deb]
Expand Down

0 comments on commit 99c654c

Please sign in to comment.