fixes
Some checks failed
build-service / build-and-release (push) Failing after 5s

This commit is contained in:
2026-05-14 20:10:18 -05:00
parent 20313de5dc
commit 85f8e6eded

View File

@@ -6,16 +6,11 @@ on:
tags: ["v*"] tags: ["v*"]
jobs: jobs:
build: build-and-release:
name: Build ${{ matrix.target }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: # Added permissions explicitly to prevent the "Blocked" error
matrix: permissions:
include: contents: write
- target: x86_64-unknown-linux-gnu
use-cross: false
- target: aarch64-unknown-linux-gnu
use-cross: true
steps: steps:
- name: Checkout repository - name: Checkout repository
@@ -24,56 +19,40 @@ jobs:
- name: Install Rust toolchain - name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable uses: dtolnay/rust-toolchain@stable
with: with:
targets: ${{ matrix.target }} targets: x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu
- name: Install cross - name: Install cross
if: matrix.use-cross == true
uses: taiki-e/install-action@v2 uses: taiki-e/install-action@v2
with: with:
tool: cross tool: cross
- name: Build binary - name: Build x86_64 (Native)
run: cargo build --release --target x86_64-unknown-linux-gnu
- name: Build ARM64 (Cross)
env: env:
CROSS_CONTAINER_IN_CONTAINER: true CROSS_CONTAINER_IN_CONTAINER: true
run: cross build --release --target aarch64-unknown-linux-gnu
- name: Prepare Binaries
run: | run: |
if [ "${{ matrix.use-cross }}" == "true" ]; then mkdir -p release-artifacts
cross build --release --target ${{ matrix.target }} cp target/x86_64-unknown-linux-gnu/release/escape_room_server release-artifacts/escape_room_server-x86_64
else cp target/aarch64-unknown-linux-gnu/release/escape_room_server release-artifacts/escape_room_server-aarch64
cargo build --release --target ${{ matrix.target }}
fi
# Prepare binary for upload - name: Upload Artifacts (Internal)
mkdir -p staging
cp target/${{ matrix.target }}/release/escape_room_server staging/escape_room_server-${{ matrix.target }}
- name: Upload artifacts (Internal)
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: binary-${{ matrix.target }} name: escape-room-binaries
path: staging/escape_room_server-${{ matrix.target }} path: release-artifacts/*
release:
name: Gitea Release
needs: build
# CRITICAL: This ensures the release job ONLY runs when you push a tag
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: release-bins
pattern: binary-*
merge-multiple: true
- name: Create Gitea Release - name: Create Gitea Release
# Using a Gitea-compatible release action # This only runs if the push was a tag
uses: https://github.com/softprops/action-gh-release@v2 if: startsWith(github.ref, 'refs/tags/')
uses: https://gitea.com/actions/release-action@v1
with: with:
# Gitea uses the same 'GITHUB_TOKEN' secret name by default files: |
token: ${{ secrets.GITHUB_TOKEN }} release-artifacts/escape_room_server-x86_64
files: release-bins/* release-artifacts/escape_room_server-aarch64
draft: false api_key: ${{ secrets.GITHUB_TOKEN }}
prerelease: false base_url: ${{ github.server_url }}
generate_release_notes: true