Compare commits
3 Commits
56275c7369
...
b96f00c847
| Author | SHA1 | Date | |
|---|---|---|---|
| b96f00c847 | |||
| 85f8e6eded | |||
| 20313de5dc |
@@ -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,27 +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)
|
||||||
env:
|
run: cargo build --release --target x86_64-unknown-linux-gnu
|
||||||
# This is the magic fix for 'act' and Docker-in-Docker
|
|
||||||
CROSS_CONTAINER_IN_CONTAINER: true
|
|
||||||
run: |
|
|
||||||
if [ "${{ matrix.use-cross }}" == "true" ]; then
|
|
||||||
cross build --release --target ${{ matrix.target }}
|
|
||||||
else
|
|
||||||
cargo build --release --target ${{ matrix.target }}
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Upload artifacts
|
- name: Build ARM64 (Cross)
|
||||||
|
env:
|
||||||
|
CROSS_CONTAINER_IN_CONTAINER: true
|
||||||
|
run: cross build --release --target aarch64-unknown-linux-gnu
|
||||||
|
|
||||||
|
- name: Prepare Binaries
|
||||||
|
run: |
|
||||||
|
mkdir -p release-artifacts
|
||||||
|
cp target/x86_64-unknown-linux-gnu/release/escape_room_server release-artifacts/escape_room_server-x86_64
|
||||||
|
cp target/aarch64-unknown-linux-gnu/release/escape_room_server release-artifacts/escape_room_server-aarch64
|
||||||
|
|
||||||
|
- name: Upload Artifacts (Internal)
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: escape-room-server-${{ matrix.target }}
|
name: escape-room-binaries
|
||||||
path: target/${{ matrix.target }}/release/escape_room_server
|
path: release-artifacts/*
|
||||||
|
|
||||||
|
- name: Create Gitea Release
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
# Change @v1 to @main
|
||||||
|
uses: https://gitea.com/actions/release-action@main
|
||||||
|
with:
|
||||||
|
files: |
|
||||||
|
release-artifacts/escape_room_server-x86_64
|
||||||
|
release-artifacts/escape_room_server-aarch64
|
||||||
|
api_key: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
base_url: ${{ github.server_url }}
|
||||||
|
|||||||
Reference in New Issue
Block a user