using ubuntu with rust install
Some checks failed
build-service / build (push) Failing after 1m2s

This commit is contained in:
2026-05-14 19:55:59 -05:00
parent 44fd16d9c7
commit 5211266f3a

View File

@@ -9,32 +9,62 @@ jobs:
build:
runs-on: ubuntu-latest
# 🔥 EVERYTHING runs inside Rust container (no host Rust used)
container:
image: rust:latest
image: ubuntu:22.04
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
uses: actions/checkout@v4
# 🔥 install cross INSIDE container
# =========================
# 4. 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
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
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
uses: actions/upload-artifact@v4
@@ -43,27 +73,3 @@ jobs:
path: |
target/x86_64-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