This commit is contained in:
@@ -9,32 +9,62 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
# 🔥 EVERYTHING runs inside Rust container (no host Rust used)
|
|
||||||
container:
|
container:
|
||||||
image: rust:latest
|
image: ubuntu:22.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
# =========================
|
||||||
|
# 1. system dependencies
|
||||||
|
# =========================
|
||||||
|
- name: install system deps
|
||||||
|
run: |
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y \
|
||||||
|
git curl ca-certificates build-essential
|
||||||
|
|
||||||
|
# =========================
|
||||||
|
# 2. install Rust (user-space, correct PATH)
|
||||||
|
# =========================
|
||||||
|
- name: install rust
|
||||||
|
run: |
|
||||||
|
curl https://sh.rustup.rs -sSf | sh -s -- -y
|
||||||
|
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
||||||
|
. "$HOME/.cargo/env"
|
||||||
|
rustc --version
|
||||||
|
cargo --version
|
||||||
|
|
||||||
|
# =========================
|
||||||
|
# 3. checkout (NOW works because git exists)
|
||||||
|
# =========================
|
||||||
- name: checkout
|
- name: checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
# 🔥 install cross INSIDE container
|
# =========================
|
||||||
|
# 4. install cross
|
||||||
|
# =========================
|
||||||
- name: install cross
|
- name: install cross
|
||||||
run: cargo install cross --locked
|
run: |
|
||||||
|
. "$HOME/.cargo/env"
|
||||||
|
cargo install cross --locked
|
||||||
|
|
||||||
# =========================
|
# =========================
|
||||||
# 🧱 X86_64 BUILD
|
# 5. build x86_64
|
||||||
# =========================
|
# =========================
|
||||||
- name: build x86_64
|
- name: build x86_64
|
||||||
run: cargo build --release --target x86_64-unknown-linux-gnu
|
run: |
|
||||||
|
. "$HOME/.cargo/env"
|
||||||
|
cargo build --release --target x86_64-unknown-linux-gnu
|
||||||
|
|
||||||
# =========================
|
# =========================
|
||||||
# 🧱 ARM64 BUILD (FIXED)
|
# 6. build ARM64 via cross
|
||||||
# =========================
|
# =========================
|
||||||
- name: build arm64
|
- name: build arm64
|
||||||
run: cross build --release --target aarch64-unknown-linux-gnu
|
run: |
|
||||||
|
. "$HOME/.cargo/env"
|
||||||
|
cross build --release --target aarch64-unknown-linux-gnu
|
||||||
|
|
||||||
# =========================
|
# =========================
|
||||||
# 📦 ARTIFACT UPLOAD
|
# 7. upload artifacts
|
||||||
# =========================
|
# =========================
|
||||||
- name: upload artifacts
|
- name: upload artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
@@ -43,27 +73,3 @@ jobs:
|
|||||||
path: |
|
path: |
|
||||||
target/x86_64-unknown-linux-gnu/release/escape_room_server
|
target/x86_64-unknown-linux-gnu/release/escape_room_server
|
||||||
target/aarch64-unknown-linux-gnu/release/escape_room_server
|
target/aarch64-unknown-linux-gnu/release/escape_room_server
|
||||||
|
|
||||||
# =========================
|
|
||||||
# 🚀 CREATE GITEA RELEASE (only on tags)
|
|
||||||
# =========================
|
|
||||||
- name: create release
|
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
|
||||||
uses: actions/create-release@v1
|
|
||||||
with:
|
|
||||||
tag_name: ${{ github.ref_name }}
|
|
||||||
release_name: Release ${{ github.ref_name }}
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
# =========================
|
|
||||||
# 📎 UPLOAD RELEASE ASSETS
|
|
||||||
# =========================
|
|
||||||
- name: upload release assets
|
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
|
||||||
uses: actions/upload-release-asset@v1
|
|
||||||
with:
|
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
||||||
asset_path: target/x86_64-unknown-linux-gnu/release/escape_room_server
|
|
||||||
asset_name: escape_room_server-x86_64
|
|
||||||
asset_content_type: application/octet-stream
|
|
||||||
|
|||||||
Reference in New Issue
Block a user