diff --git a/.github/workflows/test-ci-release.yml b/.github/workflows/test-ci-release.yml new file mode 100644 index 0000000000..f92fc5f4f7 --- /dev/null +++ b/.github/workflows/test-ci-release.yml @@ -0,0 +1,67 @@ +name: Test nix on + +on: + push: + branches: [ feat/nix ] +jobs: + release-ubuntu: + name: Build for Linux + runs-on: ubuntu-latest + env: + CARGO_TERM_COLOR: always + steps: + - uses: actions/checkout@v4 + - uses: DeterminateSystems/nix-installer-action@v9 + - name: build linux-musl + run: nix build -L .#fastn + - name: test the output binary + run: ldd result/bin/fastn + run: ./result/bin/fastn --version + # - name: Build-musl + # run: | + # echo "Building static binaries using ekidd/rust-musl-builder" + # docker build -t fastn-build-image -f .github/Dockerfile . + # docker run --name fastn-build fastn-build-image + # mkdir -p out + # docker cp fastn-build:/home/rust/src/target/x86_64-unknown-linux-musl/release/fastn out/ + # - name: run fastn + # run: out/fastn --version + # - uses: actions/upload-artifact@v4 + # with: + # name: linux_musl_x86_64 + # path: out/fastn + release-windows: + name: Build for win 64 + runs-on: ubuntu-latest + env: + CARGO_TERM_COLOR: always + steps: + - uses: actions/checkout@v4 + - uses: DeterminateSystems/nix-installer-action@v9 + - name: build mingwW64 + run: nix build -L .#fastn-win + - name: test the output binary + # wine? + # run: ldd result/bin/fastn.exe + # run: ./result/bin/fastn.exe --version + run: ls result/bin/ + run: file result/bin/fastn.exe + run: ldd result/bin/fastn.exe + release-macos: + name: Build for MacOS + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + - uses: DeterminateSystems/nix-installer-action@v9 + - name: build mac + run: nix build -L .#fastn + - name: test the output binary on mac + run: ldd result/bin/fastn + run: ./result/bin/fastn --version + # - name: run fastn + # run: ./target/release/fastn --version + # - uses: actions/upload-artifact@v4 + # with: + # name: macos_x64_latest + # path: | + # target/release/fastn diff --git a/fastn.nix b/fastn.nix index 36e623d130..398b784783 100644 --- a/fastn.nix +++ b/fastn.nix @@ -1,9 +1,14 @@ { rustPlatform, stdenv, pkg-config, lib, windows, openssl }: +let + fastnCargo = builtins.fromTOML (builtins.readFile ./fastn/Cargo.toml); + version = fastnCargo.package.version; +in rustPlatform.buildRustPackage { name = "fastn"; - version = "0.4.47"; + inherit version; src = lib.cleanSource ./.; - doCheck = false; + + doCheck = false; # set this to true to run cargo test nativeBuildInputs = [ pkg-config ]; diff --git a/flake.nix b/flake.nix index 84e75362ed..8efb538412 100644 --- a/flake.nix +++ b/flake.nix @@ -2,6 +2,8 @@ inputs = { flake-utils.url = "github:numtide/flake-utils"; + # TODO: use nixpkgs/unstable when this is merged: + # https://github.com/NixOS/nixpkgs/pull/282798 nixpkgs.url = "github:junjihashimoto/nixpkgs/feature/rust-dup"; };