fix(ci): use nix instead of ubuntu
Some checks failed
Build Zenyx ⚡ / 🔧 Setup Environment (push) Successful in 12s
Build Zenyx ⚡ / 🏗️ Build universal2-apple-darwin (push) Has been skipped
Build Zenyx ⚡ / 🧪 Run Cargo Tests (push) Successful in 6m8s
Build Zenyx ⚡ / 🏗️ Build x86_64-unknown-linux-gnu (push) Failing after 5m20s
Build Zenyx ⚡ / 🏗️ Build aarch64-unknown-linux-gnu (push) Failing after 5m26s
Build Zenyx ⚡ / 🏗️ Build x86_64-pc-windows-msvc (push) Successful in 8m15s
Build Zenyx ⚡ / 🏗️ Build aarch64-pc-windows-msvc (push) Successful in 8m37s
Some checks failed
Build Zenyx ⚡ / 🔧 Setup Environment (push) Successful in 12s
Build Zenyx ⚡ / 🏗️ Build universal2-apple-darwin (push) Has been skipped
Build Zenyx ⚡ / 🧪 Run Cargo Tests (push) Successful in 6m8s
Build Zenyx ⚡ / 🏗️ Build x86_64-unknown-linux-gnu (push) Failing after 5m20s
Build Zenyx ⚡ / 🏗️ Build aarch64-unknown-linux-gnu (push) Failing after 5m26s
Build Zenyx ⚡ / 🏗️ Build x86_64-pc-windows-msvc (push) Successful in 8m15s
Build Zenyx ⚡ / 🏗️ Build aarch64-pc-windows-msvc (push) Successful in 8m37s
This commit is contained in:
parent
b97dd094e1
commit
2e68eefa3c
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
|
13
flake.nix
13
flake.nix
|
@ -41,6 +41,9 @@
|
|||
cargo-cross
|
||||
cargo-xwin
|
||||
cargo-wizard
|
||||
git
|
||||
git-lfs
|
||||
zig_0_12
|
||||
wine64
|
||||
pkg-config
|
||||
];
|
||||
|
@ -73,7 +76,15 @@
|
|||
nativeBuildInputs = with pkgs; [
|
||||
(rust-bin.stable.latest.default.override {
|
||||
extensions = ["rust-src" "cargo" "rustfmt" "clippy"];
|
||||
targets = [ "x86_64-pc-windows-msvc" "x86_64-unknown-linux-gnu" ];
|
||||
targets = [
|
||||
"x86_64-pc-windows-msvc"
|
||||
"x86_64-unknown-linux-gnu"
|
||||
"x86_64-apple-darwin"
|
||||
"aarch64-unknown-linux-gnu"
|
||||
"aarch64-pc-windows-msvc"
|
||||
"aarch64-apple-darwin"
|
||||
# "universal2-apple-darwin"
|
||||
];
|
||||
|
||||
})
|
||||
pkg-config
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue