diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 5f9d9dd..0ad38e6 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -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: @@ -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: @@ -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 @@ -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: diff --git a/Makefile.toml b/Makefile.toml index 979ebe3..2600f46 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -1,7 +1,7 @@ [env] # use for build arm64 in docker -CROSS_CONTAINER_IN_CONTAINER = true +# CROSS_CONTAINER_IN_CONTAINER = true [tasks.ci] @@ -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 = ''' @@ -44,6 +44,7 @@ script = ''' [tasks.clear-artifacts] script_runner = "@shell" +ignore_errors = true script = ["rm -r artifacts"] [tasks.build_deb]