Skip to content

Commit

Permalink
add pkgs, add release notes
Browse files Browse the repository at this point in the history
  • Loading branch information
elohmeier committed Aug 23, 2022
1 parent 81c84b5 commit e24e15a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v17
- run: nix --version
- run: nix build .#pkgsCross.musl64.pkgsStatic.nmap
- run: nix build
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
result/bin/nmap
body_path: result/release.txt
files: result/bin/*
22 changes: 21 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,26 @@
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system);
in
{
packages = forAllSystems (system: (import nixpkgs { inherit system; }));
defaultPackage = forAllSystems (system: (with import nixpkgs { inherit system; }; (
let
releaseNotes = writeText "release.txt" ''
- nmap v${nmap.version}
- python2 v${python2.version}
- tcpdump v${tcpdump.version}
'';
in
runCommand "static-binaries" { } ''
mkdir -p $out/bin
cp ${pkgsCross.musl32.pkgsStatic.nmap}/bin/nmap $out/bin/nmap-x86
cp ${pkgsCross.musl32.pkgsStatic.python2}/bin/python2.7 $out/bin/python2.7-x86
cp ${pkgsCross.musl32.pkgsStatic.tcpdump}/bin/tcpdump $out/bin/tcpdump-x86
cp ${pkgsCross.musl64.pkgsStatic.nmap}/bin/nmap $out/bin/nmap-x64
cp ${pkgsCross.musl64.pkgsStatic.python2}/bin/python2.7 $out/bin/python2.7-x64
cp ${pkgsCross.musl64.pkgsStatic.tcpdump}/bin/tcpdump $out/bin/tcpdump-x64
cp ${releaseNotes} $out/release.txt
''
)
));
};
}

0 comments on commit e24e15a

Please sign in to comment.