Compare commits
5 Commits
56275c7369
...
v1.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
| a3f495f87b | |||
| 5615622acc | |||
| b96f00c847 | |||
| 85f8e6eded | |||
| 20313de5dc |
@@ -1,50 +0,0 @@
|
|||||||
name: build-service
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [main]
|
|
||||||
tags: ["v*"]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
name: Build ${{ matrix.target }}
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- target: x86_64-unknown-linux-gnu
|
|
||||||
use-cross: false
|
|
||||||
- target: aarch64-unknown-linux-gnu
|
|
||||||
use-cross: true
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Install Rust toolchain
|
|
||||||
uses: dtolnay/rust-toolchain@stable
|
|
||||||
with:
|
|
||||||
targets: ${{ matrix.target }}
|
|
||||||
|
|
||||||
- name: Install cross
|
|
||||||
if: matrix.use-cross == true
|
|
||||||
uses: taiki-e/install-action@v2
|
|
||||||
with:
|
|
||||||
tool: cross
|
|
||||||
|
|
||||||
- name: Build binary
|
|
||||||
env:
|
|
||||||
# This is the magic fix for 'act' and Docker-in-Docker
|
|
||||||
CROSS_CONTAINER_IN_CONTAINER: true
|
|
||||||
run: |
|
|
||||||
if [ "${{ matrix.use-cross }}" == "true" ]; then
|
|
||||||
cross build --release --target ${{ matrix.target }}
|
|
||||||
else
|
|
||||||
cargo build --release --target ${{ matrix.target }}
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Upload artifacts
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: escape-room-server-${{ matrix.target }}
|
|
||||||
path: target/${{ matrix.target }}/release/escape_room_server
|
|
||||||
21
Makefile
21
Makefile
@@ -1,21 +0,0 @@
|
|||||||
BIN_NAME := escape_room_server
|
|
||||||
OUT_DIR := ./dist
|
|
||||||
|
|
||||||
.PHONY: all clean build-x86 build-arm64
|
|
||||||
|
|
||||||
all: build-x86 build-arm64
|
|
||||||
|
|
||||||
prep:
|
|
||||||
mkdir -p $(OUT_DIR)
|
|
||||||
|
|
||||||
build-x86: prep
|
|
||||||
cargo build --release --target x86_64-unknown-linux-gnu
|
|
||||||
cp target/x86_64-unknown-linux-gnu/release/$(BIN_NAME) $(OUT_DIR)/$(BIN_NAME)-x86_64
|
|
||||||
|
|
||||||
build-arm64: prep
|
|
||||||
cross build --release --target aarch64-unknown-linux-gnu
|
|
||||||
cp target/aarch64-unknown-linux-gnu/release/$(BIN_NAME) $(OUT_DIR)/$(BIN_NAME)-arm64
|
|
||||||
|
|
||||||
clean:
|
|
||||||
cargo clean
|
|
||||||
rm -rf $(OUT_DIR)
|
|
||||||
Reference in New Issue
Block a user