name: build-service on: push: branches: [main] tags: ["v*"] jobs: build: runs-on: ubuntu-latest # 🔥 EVERYTHING runs inside Rust container (no host Rust used) container: image: rust:latest steps: - name: checkout uses: actions/checkout@v4 # 🔥 install cross INSIDE container - name: install cross run: cargo install cross --locked # ========================= # 🧱 X86_64 BUILD # ========================= - name: build x86_64 run: cargo build --release --target x86_64-unknown-linux-gnu # ========================= # 🧱 ARM64 BUILD (FIXED) # ========================= - name: build arm64 run: cross build --release --target aarch64-unknown-linux-gnu # ========================= # 📦 ARTIFACT UPLOAD # ========================= - name: upload artifacts uses: actions/upload-artifact@v4 with: name: escape-room-binaries 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