change github workflow to be forgejo compatible
This commit is contained in:
parent
43e157a3d0
commit
242520098b
4 changed files with 61 additions and 112 deletions
57
.forgejo/workflows/rust.yml
Normal file
57
.forgejo/workflows/rust.yml
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
name: Build Zenyx ⚡
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
env:
|
||||||
|
CARGO_TERM_COLOR: always
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
target:
|
||||||
|
- x86_64-unknown-linux-gnu
|
||||||
|
- aarch64-unknown-linux-gnu
|
||||||
|
include:
|
||||||
|
- target: x86_64-unknown-linux-gnu
|
||||||
|
binary_name: zenyx-x86_64
|
||||||
|
- target: aarch64-unknown-linux-gnu
|
||||||
|
binary_name: zenyx-aarch64
|
||||||
|
runs-on: codeberg-small
|
||||||
|
steps:
|
||||||
|
- name: 📥 Clone repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: 🛠️ Install cross-compilation dependencies
|
||||||
|
run: |
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu qemu-user
|
||||||
|
|
||||||
|
- name: 🔧 Install Rust
|
||||||
|
uses: https://github.com/actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
override: true
|
||||||
|
target: ${{ matrix.target }}
|
||||||
|
profile: minimal
|
||||||
|
|
||||||
|
- name: 🏗️ Build
|
||||||
|
uses: https://github.com/actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: build
|
||||||
|
args: --release --target ${{ matrix.target }}
|
||||||
|
env:
|
||||||
|
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
|
||||||
|
|
||||||
|
- name: 📦 Prepare binary
|
||||||
|
run: |
|
||||||
|
mkdir -p artifacts
|
||||||
|
cp target/${{ matrix.target }}/release/zenyx artifacts/${{ matrix.binary_name }}
|
||||||
|
chmod +x artifacts/${{ matrix.binary_name }}
|
||||||
|
|
||||||
|
- name: Upload artifacts
|
||||||
|
uses: https://code.forgejo.org/forgejo/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.binary_name }}
|
||||||
|
path: artifacts/${{ matrix.binary_name }}
|
||||||
|
compression-level: 9
|
112
.github/workflows/rust.yml
vendored
112
.github/workflows/rust.yml
vendored
|
@ -1,112 +0,0 @@
|
||||||
name: Build Zenyx ⚡
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags: ["v*"]
|
|
||||||
env:
|
|
||||||
CARGO_TERM_COLOR: always
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
||||||
arch: [x86_64, aarch64]
|
|
||||||
include:
|
|
||||||
- arch: x86_64
|
|
||||||
target: x86_64-unknown-linux-gnu
|
|
||||||
binary_name: zenyx-linux-x86_64.zip
|
|
||||||
file_extension: ""
|
|
||||||
- arch: aarch64
|
|
||||||
target: aarch64-unknown-linux-gnu
|
|
||||||
binary_name: zenyx-linux-aarch64.zip
|
|
||||||
file_extension: ""
|
|
||||||
- os: windows-latest
|
|
||||||
arch: x86_64
|
|
||||||
target: x86_64-pc-windows-msvc
|
|
||||||
binary_name: zenyx-windows-x86_64.zip
|
|
||||||
file_extension: ".exe"
|
|
||||||
- os: macos-latest
|
|
||||||
arch: x86_64
|
|
||||||
target: x86_64-apple-darwin
|
|
||||||
binary_name: zenyx-macos-x86_64.zip
|
|
||||||
file_extension: ""
|
|
||||||
- os: macos-latest
|
|
||||||
arch: aarch64
|
|
||||||
target: aarch64-apple-darwin
|
|
||||||
binary_name: zenyx-macos-aarch64.zip
|
|
||||||
file_extension: ""
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: 📥 Clone repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- name: 🛠️ Install cross-compilation dependencies (Ubuntu AMD)
|
|
||||||
if: runner.os == 'Linux'
|
|
||||||
run: |
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu qemu-user
|
|
||||||
- name: 🛠️ Install cross-compilation dependencies (macOS🍎)
|
|
||||||
if: runner.os == 'macOS'
|
|
||||||
run: |
|
|
||||||
brew install FiloSottile/musl-cross/musl-cross
|
|
||||||
- name: 🔧 Install Rust
|
|
||||||
uses: actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
toolchain: nightly
|
|
||||||
override: true
|
|
||||||
target: ${{ matrix.target }}
|
|
||||||
profile: minimal
|
|
||||||
- name: 🏗️ Build
|
|
||||||
uses: actions-rs/cargo@v1
|
|
||||||
with:
|
|
||||||
command: build
|
|
||||||
args: --release --target ${{ matrix.target }}
|
|
||||||
env:
|
|
||||||
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
|
|
||||||
- name: 📦 Prepare binary and checksum
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
# Create temp directory for zip contents
|
|
||||||
mkdir -p temp_release
|
|
||||||
# Copy binary to temp directory
|
|
||||||
cp target/${{ matrix.target }}/release/zenyx${{ matrix.file_extension }} temp_release/zenyx${{ matrix.file_extension }}
|
|
||||||
chmod +x temp_release/zenyx${{ matrix.file_extension }}
|
|
||||||
# Create SHA256 checksum
|
|
||||||
cd temp_release
|
|
||||||
if [ "$RUNNER_OS" == "Windows" ]; then
|
|
||||||
certutil -hashfile zenyx${{ matrix.file_extension }} SHA256 > zenyx.sha256
|
|
||||||
# Remove certutil's extra output, keeping only the hash
|
|
||||||
sed -i '1d' zenyx.sha256
|
|
||||||
sed -i '2d' zenyx.sha256
|
|
||||||
else
|
|
||||||
shasum -a 256 zenyx${{ matrix.file_extension }} > zenyx.sha256
|
|
||||||
fi
|
|
||||||
# Create zip with both files at root level
|
|
||||||
mkdir -p ../release
|
|
||||||
zip ../release/${{ matrix.binary_name }} zenyx${{ matrix.file_extension }} zenyx.sha256
|
|
||||||
cd ..
|
|
||||||
rm -rf temp_release
|
|
||||||
- name: Upload artifacts
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: ${{ matrix.binary_name }}
|
|
||||||
path: release/${{ matrix.binary_name }}
|
|
||||||
release:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: build
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Download artifacts
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
path: release
|
|
||||||
- name: Create Release
|
|
||||||
uses: softprops/action-gh-release@v2
|
|
||||||
with:
|
|
||||||
files: release/*/*.zip
|
|
||||||
name: Release ${{ github.ref_name }}
|
|
||||||
body: |
|
|
||||||
This is the release for version ${{ github.ref_name }}.
|
|
||||||
draft: false
|
|
||||||
prerelease: false
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
[rendering]
|
||||||
|
force_vsync = true
|
||||||
|
|
||||||
|
[settings]
|
Loading…
Add table
Add a link
Reference in a new issue