Skip to content

Commit

Permalink
Improve Rust binary upload config
Browse files Browse the repository at this point in the history
  • Loading branch information
garyttierney committed Oct 13, 2024
1 parent 6261570 commit 4ef27b8
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ on:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
CARGO_INCREMENTAL: 0
CARGO_NET_GIT_FETCH_WITH_CLI: true
CARGO_NET_RETRY: 10
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
RUSTUP_MAX_RETRIES: 10

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand Down Expand Up @@ -43,20 +49,18 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Build
run: |
cargo build --target ${{ matrix.triple }} --release
mkdir artifacts/
cp target/${{ matrix.triple }}/release/laya-server artifacts/laya-server-${{ matrix.name }}
env:
RUSTFLAGS: "-C target-feature=+crt-static -C target-cpu=${{ matrix.cpu }}"
- name: "Upload artifacts"
uses: actions/upload-artifact@v4
- uses: taiki-e/setup-cross-toolchain-action@v1
with:
name: native-artifacts
path: |
target/${{ matrix.triple }}/release/laya-server-${{ matrix.name }}
target: ${{ matrix.triple }}
- uses: taiki-e/upload-rust-binary-action@v1
with:
bin: laya-server
bin-leading-dir: ${{ matrix.name }}
target: ${{ matrix.triple }}
tar: all
token: ${{ secrets.GITHUB_TOKEN }}
env:
RUSTFLAGS: "-Ctarget-cpu=${{ matrix.cpu }} -Ctarget-feature=+crt-static"
build-containers:
needs: plan
name: "${{ matrix.name }} (Docker)"
Expand Down

0 comments on commit 4ef27b8

Please sign in to comment.