From db02e326188c03b9d23c81f4d9daec3ad55cb4bf Mon Sep 17 00:00:00 2001 From: cat_or_not <41955154+catornot@users.noreply.github.com> Date: Sun, 9 Aug 2026 19:38:32 -0400 Subject: [PATCH] fix: release zip including an extra folder (#765) fix build system --- .github/workflows/release.yml | 17 +++++---------- flake.nix | 2 +- pkgs/default.nix | 39 ++++++++++++++--------------------- pkgs/northstar/default.nix | 15 ++++++-------- pkgs/zip/default.nix | 34 ++++++++++++++++++++++++++++++ 5 files changed, 61 insertions(+), 46 deletions(-) create mode 100644 pkgs/zip/default.nix diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6633d56..d2561e2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,26 +40,19 @@ jobs: - name: Upload uses: actions/upload-artifact@v5 with: - name: Northstar.release.${{ env.NORTHSTAR_VERSION }} + name: Northstar.release.v${{ env.NORTHSTAR_VERSION }} path: ./result - - name: Create zip to upload + - name: Build run: | - zip --recurse-paths --quiet Northstar.release.${{ env.NORTHSTAR_VERSION }}.zip ./result - - - name: Compute SHA-512 checksum - run: | - sha512sum Northstar.release.${{ env.NORTHSTAR_VERSION }}.zip - echo "\`\`\`" >> $GITHUB_STEP_SUMMARY - sha512sum Northstar.release.${{ env.NORTHSTAR_VERSION }}.zip >> $GITHUB_STEP_SUMMARY - echo "\`\`\`" >> $GITHUB_STEP_SUMMARY + nix build .#zip - name: Upload zip to release draft uses: softprops/action-gh-release@v2 with: tag_name: v${{ env.NORTHSTAR_VERSION }} draft: true - files: Northstar.release.${{ env.NORTHSTAR_VERSION }}.zip + files: ./result/Northstar.release.v${{ env.NORTHSTAR_VERSION }}.zip build-thunderstore-package: needs: build-northstar # comment out when running locally @@ -110,7 +103,7 @@ jobs: if: ${{ !env.ACT }} # Download artifacts from previous jobs when running on GitHub's infrastructure uses: actions/download-artifact@v5 with: - name: Northstar.release.${{ env.NORTHSTAR_VERSION }} + name: Northstar.release.v${{ env.NORTHSTAR_VERSION }} path: northstar - name: Make package structure diff --git a/flake.nix b/flake.nix index 347abfa..44a4920 100644 --- a/flake.nix +++ b/flake.nix @@ -64,6 +64,6 @@ } ) // { - version = "1.31.11"; + version = "1.31.12"; }; } diff --git a/pkgs/default.nix b/pkgs/default.nix index 7e0e94f..01ca147 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -10,15 +10,6 @@ ... }: let - getPackage = pkg: self.packages.${system}.${pkg}; - listToPackages = - list: - builtins.listToAttrs ( - map (name: { - name = name; - value = getPackage name; - }) list - ); in { launcher = launcher.packages.${system}.default.overrideAttrs (final: { @@ -30,19 +21,19 @@ in plugins = plugins.packages.${system}.default; northstar-stubs = pkgs.callPackage ./northstar-stubs { }; northstar-navs = pkgs.callPackage ./northstar-navs { }; - northstar = pkgs.callPackage ./northstar ( - { - inherit - version - ; - } - // listToPackages [ - "launcher" - "mods" - "discordrpc" - "plugins" - "northstar-stubs" - "northstar-navs" - ] - ); + northstar = pkgs.callPackage ./northstar { + inherit version; + inherit (self.packages.${system}) + launcher + mods + discordrpc + plugins + northstar-stubs + northstar-navs + ; + }; + zip = pkgs.callPackage ./zip { + inherit version; + inherit (self.packages.${system}) northstar; + }; } diff --git a/pkgs/northstar/default.nix b/pkgs/northstar/default.nix index 2cb5ef8..244f252 100644 --- a/pkgs/northstar/default.nix +++ b/pkgs/northstar/default.nix @@ -20,12 +20,12 @@ pkgs.stdenv.mkDerivation (finalAttr: { noUnpack = true; phases = [ "installPhase" ]; installPhase = '' - mkdir -p $out - mkdir -p $out/bin/x64_dedi - mkdir -p $out/R2Northstar - mkdir -p $out/R2Northstar/mods/ - mkdir -p $out/R2Northstar/plugins - mkdir -p $out/R2Northstar/mods/Northstar.CustomServers/mod/maps + install -d -m 755 $out + install -d -m 755 $out/bin/x64_dedi + install -d -m 755 $out/R2Northstar + install -d -m 755 $out/R2Northstar/mods/ + install -d -m 755 $out/R2Northstar/plugins + install -d -m 755 $out/R2Northstar/mods/Northstar.CustomServers/mod/maps cp -r ${discordrpc}/bin/* $out/R2Northstar/plugins/ cp -r ${plugins}/bin/* $out/R2Northstar/plugins/ @@ -38,9 +38,6 @@ pkgs.stdenv.mkDerivation (finalAttr: { cp -r ${../../release/LEGAL.txt} $out/R2Northstar/LEGAL.txt cp -r ${../../release/r2ds.bat} $out/r2ds.bat - - # make everything writable for the end user - chmod -R u+w "$out" ''; meta = { diff --git a/pkgs/zip/default.nix b/pkgs/zip/default.nix new file mode 100644 index 0000000..8b2ff15 --- /dev/null +++ b/pkgs/zip/default.nix @@ -0,0 +1,34 @@ +{ + lib, + zip, + stdenv, + northstar, + version, +}: +let +in +stdenv.mkDerivation (finalAttr: { + pname = "NorthstarZipped"; + inherit version; + + src = northstar; + + noUnpack = true; + phases = [ "installPhase" ]; + installPhase = '' + mkdir -p $out + mkdir -p $TMPDIR/northstar + + cp -r $src/. $TMPDIR/northstar/ + chmod -R u+rwX $TMPDIR/northstar + + cd $TMPDIR/northstar + ${lib.getExe zip} -r $out/Northstar.release.v${finalAttr.version}.zip . + ''; + + meta = { + description = finalAttr.pname; + homepage = "https://northstar.tf/"; + license = lib.licenses.mit; + }; +})