fix the fix :p #22
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Globed server | |
on: | |
workflow_dispatch: | |
push: | |
jobs: | |
build: | |
name: ${{ matrix.name }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
name: Linux x64 | |
bin-suffix: "-x64" | |
- os: ubuntu-latest | |
target: aarch64-unknown-linux-gnu | |
name: Linux arm64 | |
bin-suffix: "-arm64" | |
- os: windows-latest | |
target: x86_64-pc-windows-msvc | |
name: Windows x64 | |
bin-suffix: ".exe" | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
target: ${{ matrix.target }} | |
override: true | |
- name: Add rust target | |
if: matrix.target != 'aarch64-unknown-linux-gnu' | |
run: rustup target add ${{ matrix.target }} | |
shell: bash | |
# install cross for arm target | |
- name: Install cross | |
if: matrix.target == 'aarch64-unknown-linux-gnu' | |
run: | | |
rustup target add x86_64-unknown-linux-gnu | |
cargo install cross | |
shell: bash | |
- name: Build game server (native) | |
if: matrix.target != 'aarch64-unknown-linux-gnu' | |
run: | | |
cd server | |
cargo build --release --target ${{ matrix.target }} -p globed-game-server | |
env: | |
CARGO_NET_GIT_FETCH_WITH_CLI: true | |
shell: bash | |
- name: Build game server (cross) | |
if: matrix.target == 'aarch64-unknown-linux-gnu' | |
run: | | |
cd server | |
cross build --release --target ${{ matrix.target }} -p globed-game-server | |
env: | |
CARGO_NET_GIT_FETCH_WITH_CLI: true | |
shell: bash | |
- name: Build central server (native) | |
if: matrix.target != 'aarch64-unknown-linux-gnu' | |
run: | | |
cd server/central | |
SQLX_OFFLINE=true cargo build --release --target ${{ matrix.target }} | |
env: | |
CARGO_NET_GIT_FETCH_WITH_CLI: true | |
shell: bash | |
- name: Build central server (cross) | |
if: matrix.target == 'aarch64-unknown-linux-gnu' | |
run: | | |
cd server | |
cross build --release --target ${{ matrix.target }} -p globed-central-server | |
env: | |
CARGO_NET_GIT_FETCH_WITH_CLI: true | |
shell: bash | |
- name: Create artifacts folder | |
run: | | |
mkdir -p server/artifacts | |
shell: bash | |
- name: Copy artifacts (Windows) | |
if: matrix.os == 'windows-latest' | |
run: | | |
cp server/target/${{ matrix.target }}/release/globed-game-server.exe server/artifacts/globed-game-server${{ matrix.bin-suffix }} || : | |
cp server/target/${{ matrix.target }}/release/globed-central-server.exe server/artifacts/globed-central-server${{ matrix.bin-suffix }} || : | |
shell: bash | |
- name: Copy artifacts (Linux) | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
cp server/target/${{ matrix.target }}/release/globed-game-server server/artifacts/globed-game-server${{ matrix.bin-suffix }} || : | |
cp server/target/${{ matrix.target }}/release/globed-central-server server/artifacts/globed-central-server${{ matrix.bin-suffix }} || : | |
shell: bash | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.target }}-build | |
path: server/artifacts/* | |
merge: | |
name: Merge artifacts | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Merge artifacts | |
uses: actions/upload-artifact/merge@v4 | |
with: | |
name: globed-server-build | |
delete-merged: true |