This commit is contained in:
Robin Appelman 2023-12-11 21:44:13 +01:00
commit 91e605cc57
2 changed files with 15 additions and 5 deletions

View file

@ -37,7 +37,7 @@ jobs:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v20
- id: set-matrix
run: echo "matrix={\"target\":$(nix eval --json ".#targets.x86_64-linux")}" | tee $GITHUB_OUTPUT
run: echo "matrix=$(nix eval --json ".#matrix.x86_64-linux")" | tee $GITHUB_OUTPUT
build:
runs-on: ubuntu-latest
@ -56,5 +56,5 @@ jobs:
- run: nix build .#${{ matrix.target }}
- uses: actions/upload-artifact@v3
with:
name: parser-${{ matrix.target }}
path: result/bin/vbspview
name: vbspview-${{ matrix.asset_suffix }}
path: result/bin/vbspview${{ matrix.artifact_suffix }}

View file

@ -35,8 +35,8 @@
hostTarget = pkgs.hostPlatform.config;
targets = ["x86_64-unknown-linux-musl" "x86_64-pc-windows-gnu" hostTarget];
artifactForTarget = target: "parse_demo${cross-naersk'.execSufficForTarget target}";
assetNameForTarget = target: "parser-${builtins.replaceStrings ["-unknown" "-gnu" "-musl" "eabihf" "-pc"] ["" "" "" "" ""] target}${cross-naersk'.execSufficForTarget target}";
artifactSuffixForTarget = cross-naersk'.execSufficForTarget;
assetSuffixForTarget = target: "${builtins.replaceStrings ["-unknown" "-gnu" "-musl" "eabihf" "-pc"] ["" "" "" "" ""] target}${cross-naersk'.execSufficForTarget target}";
hostNaersk = naerskForTarget hostTarget;
cross-naersk' = pkgs.callPackage cross-naersk {inherit naersk;};
@ -59,6 +59,14 @@
egl-wayland
libGL
];
buildMatrix = targets: {
include = builtins.map (target: {
inherit target;
artifact_suffix = artifactSuffixForTarget target;
asset_suffix = assetSuffixForTarget target;
}) targets;
};
in rec {
packages = (lib.attrsets.genAttrs targets (target:(cross-naersk'.buildPackage target) nearskOpt)) // rec {
vbspview = packages.${hostTarget};
@ -71,6 +79,8 @@
default = vbspview;
};
matrix = buildMatrix targets;
inherit targets;
devShells.default = pkgs.mkShell {