From 5211266f3afd32a8efed46db994a116d0a485508 Mon Sep 17 00:00:00 2001 From: KeshavAnandCode Date: Thu, 14 May 2026 19:55:59 -0500 Subject: [PATCH] using ubuntu with rust install --- .gitea/workflows/build.yml | 72 +++++++++++++++++++++----------------- 1 file changed, 39 insertions(+), 33 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 6c58e61..1b41fb3 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -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