fix: release zip including an extra folder (#765)

fix build system
This commit is contained in:
cat_or_not 2026-08-09 19:38:32 -04:00 committed by GitHub
parent a213ed25e3
commit db02e32618
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 61 additions and 46 deletions

View file

@ -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

View file

@ -64,6 +64,6 @@
}
)
// {
version = "1.31.11";
version = "1.31.12";
};
}

View file

@ -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;
};
}

View file

@ -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 = {

34
pkgs/zip/default.nix Normal file
View file

@ -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;
};
})