From 4d1a866df064912229f82f8df5aa070bdeee2afa Mon Sep 17 00:00:00 2001 From: Patrick Kerwood Date: Mon, 27 Jan 2025 18:02:34 +0100 Subject: [PATCH] updated gh action --- .github/workflows/build-n-release.yml | 43 +++++++++------------------ 1 file changed, 14 insertions(+), 29 deletions(-) diff --git a/.github/workflows/build-n-release.yml b/.github/workflows/build-n-release.yml index 248d86b..789d35d 100644 --- a/.github/workflows/build-n-release.yml +++ b/.github/workflows/build-n-release.yml @@ -16,42 +16,27 @@ jobs: rustfmt: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - run: rustup component add rustfmt - run: cargo fmt -- --check build-linux: runs-on: ubuntu-latest + needs: rustfmt steps: - name: Checkout - uses: actions/checkout@v1 + uses: actions/checkout@v4 - - name: Cache Rust dependencies - uses: actions/cache@v1.0.1 + - name: Compile + id: compile + uses: rust-build/rust-build.action@v1.4.5 with: - path: target - key: ${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.OS }}-build- - - name: Install latest rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: beta - default: true - override: true + RUSTTARGET: x86_64-unknown-linux-musl - - name: Build - run: | - sudo apt update && sudo apt install musl-tools - rustup target add x86_64-unknown-linux-musl - cargo build --release --target x86_64-unknown-linux-musl - upx --best --lzma target/x86_64-unknown-linux-musl/release/${{ env.app-name }} - mv target/x86_64-unknown-linux-musl/release/${{ env.app-name }} target/x86_64-unknown-linux-musl/release/${{ env.app-name }}-x86_64-unknown-linux-musl - - name: Upload binaries to release - uses: svenstaro/upload-release-action@v1-release - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: target/x86_64-unknown-linux-musl/release/${{ env.app-name }}-x86_64-unknown-linux-musl - asset_name: ${{ env.app-name }}-x86_64-unknown-linux-musl - tag: ${{ github.ref }} - overwrite: true + # - name: Upload artifact + # uses: actions/upload-artifact@v3 + # with: + # name: Binary + # path: | + # ${{ steps.compile.outputs.BUILT_ARCHIVE }} + # ${{ steps.compile.outputs.BUILT_CHECKSUM }}