This commit is contained in:
@@ -1,8 +1,5 @@
|
|||||||
name: build-service
|
name: build-service
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
@@ -10,27 +7,63 @@ on:
|
|||||||
tags:
|
tags:
|
||||||
- "v*"
|
- "v*"
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
compile-binaries:
|
compile-binaries:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
# -----------------------------
|
||||||
|
# Checkout
|
||||||
|
# -----------------------------
|
||||||
- name: checkout
|
- name: checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
# -----------------------------
|
||||||
|
# Cargo cache (BIG SPEED BOOST)
|
||||||
|
# -----------------------------
|
||||||
|
- name: cache cargo
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cargo/registry
|
||||||
|
~/.cargo/git
|
||||||
|
target
|
||||||
|
key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
cargo-${{ runner.os }}-
|
||||||
|
|
||||||
|
# -----------------------------
|
||||||
|
# Rust toolchain
|
||||||
|
# -----------------------------
|
||||||
- name: install-rust
|
- name: install-rust
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@stable
|
||||||
with:
|
with:
|
||||||
targets: aarch64-unknown-linux-gnu,x86_64-unknown-linux-gnu
|
targets: x86_64-unknown-linux-gnu,aarch64-unknown-linux-gnu
|
||||||
|
|
||||||
|
# -----------------------------
|
||||||
|
# Install cross (ARM builds)
|
||||||
|
# -----------------------------
|
||||||
|
- name: install-cross
|
||||||
|
run: cargo install cross --git https://github.com/cross-rs/cross
|
||||||
|
|
||||||
|
# -----------------------------
|
||||||
|
# Build x86_64 (native)
|
||||||
|
# -----------------------------
|
||||||
- name: build-x86
|
- name: build-x86
|
||||||
run: cargo build --release --target x86_64-unknown-linux-gnu
|
run: cargo build --release --target x86_64-unknown-linux-gnu
|
||||||
|
|
||||||
|
# -----------------------------
|
||||||
|
# Build ARM64 (via cross)
|
||||||
|
# -----------------------------
|
||||||
- name: build-arm64
|
- name: build-arm64
|
||||||
env:
|
run: cross build --release --target aarch64-unknown-linux-gnu
|
||||||
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
|
|
||||||
run: cargo build --release --target aarch64-unknown-linux-gnu
|
|
||||||
|
|
||||||
|
# -----------------------------
|
||||||
|
# Package outputs
|
||||||
|
# -----------------------------
|
||||||
- name: prepare-release-files
|
- name: prepare-release-files
|
||||||
run: |
|
run: |
|
||||||
mkdir -p dist
|
mkdir -p dist
|
||||||
@@ -45,18 +78,21 @@ jobs:
|
|||||||
|
|
||||||
cd dist
|
cd dist
|
||||||
|
|
||||||
zip escape_room_server-linux-x86_64.zip \
|
zip escape_room_server-linux-x86_64.zip escape_room_server-linux-x86_64
|
||||||
escape_room_server-linux-x86_64
|
zip escape_room_server-linux-arm64.zip escape_room_server-linux-arm64
|
||||||
|
|
||||||
zip escape_room_server-linux-arm64.zip \
|
|
||||||
escape_room_server-linux-arm64
|
|
||||||
|
|
||||||
|
# -----------------------------
|
||||||
|
# Upload artifacts (CI downloads)
|
||||||
|
# -----------------------------
|
||||||
- name: upload-artifacts
|
- name: upload-artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: escape-room-binaries
|
name: escape-room-binaries
|
||||||
path: dist/*.zip
|
path: dist/*.zip
|
||||||
|
|
||||||
|
# -----------------------------
|
||||||
|
# Create Git release on tags
|
||||||
|
# -----------------------------
|
||||||
- name: create-release
|
- name: create-release
|
||||||
if: startsWith(gitea.ref, 'refs/tags/v')
|
if: startsWith(gitea.ref, 'refs/tags/v')
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
|
|||||||
Reference in New Issue
Block a user