fix(ci): use nix instead of ubuntu
Some checks failed
Build Zenyx ⚡ / 🧪 Run Cargo Tests (push) Has been cancelled
Build Zenyx ⚡ / 🏗️ Build aarch64-unknown-linux-gnu (push) Has been cancelled
Build Zenyx ⚡ / 🏗️ Build universal2-apple-darwin (push) Has been cancelled
Build Zenyx ⚡ / 🏗️ Build x86_64-unknown-linux-gnu (push) Has been cancelled
Build Zenyx ⚡ / 🏗️ Build aarch64-pc-windows-msvc (push) Has been cancelled
Build Zenyx ⚡ / 🏗️ Build x86_64-pc-windows-msvc (push) Has been cancelled
Build Zenyx ⚡ / 🔧 Setup Environment (push) Has been cancelled
Some checks failed
Build Zenyx ⚡ / 🧪 Run Cargo Tests (push) Has been cancelled
Build Zenyx ⚡ / 🏗️ Build aarch64-unknown-linux-gnu (push) Has been cancelled
Build Zenyx ⚡ / 🏗️ Build universal2-apple-darwin (push) Has been cancelled
Build Zenyx ⚡ / 🏗️ Build x86_64-unknown-linux-gnu (push) Has been cancelled
Build Zenyx ⚡ / 🏗️ Build aarch64-pc-windows-msvc (push) Has been cancelled
Build Zenyx ⚡ / 🏗️ Build x86_64-pc-windows-msvc (push) Has been cancelled
Build Zenyx ⚡ / 🔧 Setup Environment (push) Has been cancelled
This commit is contained in:
parent
b97dd094e1
commit
251d58c897
2 changed files with 92 additions and 1 deletions
80
.forgejo/workflows/build-release-nix.yml
Normal file
80
.forgejo/workflows/build-release-nix.yml
Normal file
|
@ -0,0 +1,80 @@
|
|||
name: Build Zenyx ⚡
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
jobs:
|
||||
cargo-test:
|
||||
name: 🧪 Run Cargo Tests
|
||||
runs-on: nixos-latest
|
||||
steps:
|
||||
- name: 📥 Checkout source
|
||||
uses: https://github.com/actions/checkout@v4
|
||||
|
||||
- name: 🚀 Setup & Run tests
|
||||
run: |
|
||||
nix-shell --run "
|
||||
git-lfs fetch
|
||||
git-lfs pull
|
||||
cargo test --release --all
|
||||
"
|
||||
|
||||
build:
|
||||
name: 🏗️ Build ${{ matrix.target }}
|
||||
needs: [cargo-test]
|
||||
runs-on: nixos-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
target:
|
||||
- x86_64-unknown-linux-gnu
|
||||
- aarch64-unknown-linux-gnu
|
||||
- x86_64-pc-windows-msvc
|
||||
- aarch64-pc-windows-msvc
|
||||
include:
|
||||
- target: x86_64-unknown-linux-gnu
|
||||
binary_name: zenyx-x86_64-linux
|
||||
ext: ""
|
||||
command: zigbuild
|
||||
args: --target x86_64-unknown-linux-gnu --release
|
||||
- target: aarch64-unknown-linux-gnu
|
||||
binary_name: zenyx-aarch64-linux
|
||||
ext: ""
|
||||
command: zigbuild
|
||||
args: --target aarch64-unknown-linux-gnu --release
|
||||
- target: x86_64-pc-windows-msvc
|
||||
binary_name: zenyx-x86_64-windows
|
||||
ext: ".exe"
|
||||
command: xwin build
|
||||
args: --target x86_64-pc-windows-msvc --release
|
||||
- target: aarch64-pc-windows-msvc
|
||||
binary_name: zenyx-aarch64-windows
|
||||
ext: ".exe"
|
||||
command: xwin build
|
||||
args: --target aarch64-pc-windows-msvc --release
|
||||
|
||||
steps:
|
||||
- name: 📥 Checkout source
|
||||
uses: https://github.com/actions/checkout@v4
|
||||
|
||||
- name: 🚀 Install Target & Build release binary
|
||||
run: |
|
||||
nix-shell --run "
|
||||
git-lfs fetch --all
|
||||
git-lfs pull
|
||||
cargo ${{ matrix.command }} ${{ matrix.args }}
|
||||
"
|
||||
|
||||
- name: 📦 Package artifact
|
||||
run: |
|
||||
mkdir -p artifacts
|
||||
cp target/${{ matrix.target }}/release/zenyx${{ matrix.ext }} artifacts/${{ matrix.binary_name }}${{ matrix.ext }}
|
||||
|
||||
- name: ⬆️ Upload artifact
|
||||
uses: https://code.forgejo.org/forgejo/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.binary_name }}${{ matrix.ext }}
|
||||
path: artifacts/${{ matrix.binary_name }}${{ matrix.ext }}
|
||||
if-no-files-found: error
|
Loading…
Add table
Add a link
Reference in a new issue