Compare commits
2 commits
f72cc0c9aa
...
e4bc2d0740
| Author | SHA1 | Date | |
|---|---|---|---|
| e4bc2d0740 | |||
| 9b5b7be0de |
2 changed files with 28 additions and 19 deletions
|
|
@ -14,18 +14,28 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Run unit tests
|
- name: Run unit tests
|
||||||
run: nix develop --command cargo test --lib
|
run: nix build --print-build-logs .#checks.x86_64-linux.default
|
||||||
|
|
||||||
build:
|
build:
|
||||||
name: Build ${{ matrix.package }}
|
name: Build ${{ matrix.target }}
|
||||||
runs-on: native
|
runs-on: native
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
package:
|
include:
|
||||||
- default
|
- package: x86_64-linux
|
||||||
- x86_64-linux-musl
|
target: x86_64-unknown-linux-gnu
|
||||||
- aarch64-linux
|
- package: x86_64-linux-musl
|
||||||
|
target: x86_64-unknown-linux-musl
|
||||||
|
- package: aarch64-linux
|
||||||
|
target: aarch64-unknown-linux-gnu
|
||||||
|
# TODO: need macOS runners for these
|
||||||
|
# - package: default
|
||||||
|
# target: x86_64-apple-darwin
|
||||||
|
# system: x86_64-darwin
|
||||||
|
# - package: default
|
||||||
|
# target: aarch64-apple-darwin
|
||||||
|
# system: aarch64-darwin
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
|
@ -34,23 +44,14 @@ jobs:
|
||||||
|
|
||||||
- name: Prepare release artifact
|
- name: Prepare release artifact
|
||||||
if: startsWith(forgejo.ref, 'refs/tags/')
|
if: startsWith(forgejo.ref, 'refs/tags/')
|
||||||
run: |
|
run: cp result/bin/mkv mkv-${{ matrix.target }}
|
||||||
target="${{ matrix.package }}"
|
|
||||||
if [ "$target" = "default" ]; then
|
|
||||||
target="x86_64-unknown-linux-gnu"
|
|
||||||
elif [ "$target" = "x86_64-linux-musl" ]; then
|
|
||||||
target="x86_64-unknown-linux-musl"
|
|
||||||
elif [ "$target" = "aarch64-linux" ]; then
|
|
||||||
target="aarch64-unknown-linux-gnu"
|
|
||||||
fi
|
|
||||||
cp result/bin/mkv "mkv-${target}"
|
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
if: startsWith(forgejo.ref, 'refs/tags/')
|
if: startsWith(forgejo.ref, 'refs/tags/')
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: mkv-${{ matrix.package }}
|
name: mkv-${{ matrix.target }}
|
||||||
path: mkv-*
|
path: mkv-${{ matrix.target }}
|
||||||
|
|
||||||
release:
|
release:
|
||||||
name: Create release
|
name: Create release
|
||||||
|
|
|
||||||
10
flake.nix
10
flake.nix
|
|
@ -35,11 +35,19 @@
|
||||||
};
|
};
|
||||||
packages = {
|
packages = {
|
||||||
default = mkv;
|
default = mkv;
|
||||||
|
x86_64-linux = mkv;
|
||||||
} // pkgs.lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
|
} // pkgs.lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
|
||||||
x86_64-linux-musl = mkMkv pkgs.pkgsCross.musl64;
|
x86_64-linux-musl = mkMkv pkgs.pkgsCross.musl64;
|
||||||
aarch64-linux = mkMkv pkgs.pkgsCross.aarch64-multiplatform;
|
aarch64-linux = mkMkv pkgs.pkgsCross.aarch64-multiplatform;
|
||||||
};
|
};
|
||||||
checks.default = mkv.overrideAttrs { doCheck = true; };
|
checks.default = mkv.overrideAttrs {
|
||||||
|
doCheck = true;
|
||||||
|
checkPhase = ''
|
||||||
|
runHook preCheck
|
||||||
|
cargo test --lib
|
||||||
|
runHook postCheck
|
||||||
|
'';
|
||||||
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue