done with actions
This commit is contained in:
@@ -1,58 +0,0 @@
|
|||||||
name: build-service
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [main]
|
|
||||||
tags: ["v*"]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-and-release:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Install Rust toolchain
|
|
||||||
uses: dtolnay/rust-toolchain@stable
|
|
||||||
with:
|
|
||||||
targets: x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu
|
|
||||||
|
|
||||||
- name: Install cross
|
|
||||||
uses: taiki-e/install-action@v2
|
|
||||||
with:
|
|
||||||
tool: cross
|
|
||||||
|
|
||||||
- name: Build x86_64 (Native)
|
|
||||||
run: cargo build --release --target x86_64-unknown-linux-gnu
|
|
||||||
|
|
||||||
- name: Build ARM64 (Cross)
|
|
||||||
env:
|
|
||||||
CROSS_CONTAINER_IN_CONTAINER: true
|
|
||||||
run: cross build --release --target aarch64-unknown-linux-gnu
|
|
||||||
|
|
||||||
- name: Prepare Binaries
|
|
||||||
run: |
|
|
||||||
mkdir -p release-artifacts
|
|
||||||
# We use find to locate the binaries regardless of the exact target folder structure
|
|
||||||
find target/x86_64-unknown-linux-gnu/release -maxdepth 1 -type f -name "escape_room_server" -exec cp {} release-artifacts/escape_room_server-x86_64 \; || cp target/release/escape_room_server release-artifacts/escape_room_server-x86_64
|
|
||||||
find target/aarch64-unknown-linux-gnu/release -maxdepth 1 -type f -name "escape_room_server" -exec cp {} release-artifacts/escape_room_server-aarch64 \;
|
|
||||||
|
|
||||||
- name: Upload Artifacts (Internal)
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: escape-room-binaries
|
|
||||||
path: release-artifacts/*
|
|
||||||
|
|
||||||
- name: Create Gitea Release
|
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
|
||||||
# Switched to @main to fix the Gitea 'reference not found' error
|
|
||||||
uses: https://gitea.com/actions/release-action@main
|
|
||||||
with:
|
|
||||||
files: |
|
|
||||||
release-artifacts/escape_room_server-x86_64
|
|
||||||
release-artifacts/escape_room_server-aarch64
|
|
||||||
api_key: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
base_url: ${{ github.server_url }}
|
|
||||||
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