Skip to content

Commit

Permalink
updated gh action
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerwood committed Jan 27, 2025
1 parent d407211 commit 4d1a866
Showing 1 changed file with 14 additions and 29 deletions.
43 changes: 14 additions & 29 deletions .github/workflows/build-n-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

0 comments on commit 4d1a866

Please sign in to comment.