ci(build): add Windows build, store release binaries
Some checks failed
Publish Docker Images / coverage-and-sonar (push) Failing after 28m17s

This commit is contained in:
2026-03-08 21:37:23 +01:00
parent c67ed67aa1
commit 57030006df
3 changed files with 55 additions and 2 deletions

View File

@@ -57,3 +57,27 @@ jobs:
env: env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
- name: Build Linux release binary
run: nix build --no-pure-eval --accept-flake-config
- name: Package Linux binary
run: zip jj-cz-linux-x86_64.zip result/bin/jj-cz LICENSE.GPL.md LICENSE.MIT.md
- name: Upload Linux artifact
uses: actions/upload-artifact@v4
with:
name: jj-cz-linux-x86_64
path: jj-cz-linux-x86_64.zip
- name: Build Windows release binary
run: nix build .#windows --no-pure-eval --accept-flake-config
- name: Package Windows binary
run: zip jj-cz-windows-x86_64.zip result/bin/jj-cz.exe LICENSE.GPL.md LICENSE.MIT.md
- name: Upload Windows artifact
uses: actions/upload-artifact@v4
with:
name: jj-cz-windows-x86_64
path: jj-cz-windows-x86_64.zip

View File

@@ -41,7 +41,36 @@
}; };
in { in {
formatter = alejandra.defaultPackage.${system}; formatter = alejandra.defaultPackage.${system};
packages = import ./nix/package.nix {inherit pkgs rustPlatform;}; packages =
(import ./nix/package.nix {inherit pkgs rustPlatform;})
// {
windows = let
mingwPkgs = pkgs.pkgsCross.mingwW64;
rustWindows = pkgs.rust-bin.stable.latest.default.override {
targets = ["x86_64-pc-windows-gnu"];
};
rustPlatformWindows = mingwPkgs.makeRustPlatform {
cargo = rustWindows;
rustc = rustWindows;
};
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
in
rustPlatformWindows.buildRustPackage {
pname = cargoToml.package.name;
version = cargoToml.package.version;
src = pkgs.lib.cleanSource ./.;
cargoLock.lockFile = ./Cargo.lock;
nativeBuildInputs = [pkgs.upx];
doCheck = false;
meta = {
description = "Conventional commits for Jujutsu";
homepage = "https://labs.phundrak.com/phundrak/jj-cz";
};
postBuild = ''
${pkgs.upx}/bin/upx target/*/release/jj-cz.exe
'';
};
};
devShell = import ./nix/shell.nix { devShell = import ./nix/shell.nix {
inherit inputs pkgs rustVersion; inherit inputs pkgs rustVersion;
}; };

View File

@@ -11,7 +11,7 @@
inherit version; inherit version;
src = pkgs.lib.cleanSource ../.; src = pkgs.lib.cleanSource ../.;
cargoLock.lockFile = ../Cargo.lock; cargoLock.lockFile = ../Cargo.lock;
buildInputs = [ pkgs.upx ]; nativeBuildInputs = [ pkgs.upx ];
useNextest = true; useNextest = true;
meta = { meta = {
description = "Conventional commits for Jujutsu"; description = "Conventional commits for Jujutsu";