Skip to content

Commit 554dcdb

Browse files
committed
Fix release tarball naming: version from git tag in CI, not hardcoded
1 parent ff7d661 commit 554dcdb

2 files changed

Lines changed: 18 additions & 7 deletions

File tree

.github/workflows/release.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,17 @@ jobs:
2424
- name: Build release tarballs
2525
run: nix run .#release
2626

27+
- name: Add version to filenames
28+
run: |
29+
cd release
30+
VERSION="${GITHUB_REF_NAME}"
31+
for f in xenomorph-*.tar.gz; do
32+
newname="${f/xenomorph-/xenomorph-${VERSION}-}"
33+
mv "$f" "$newname"
34+
done
35+
sha256sum *.tar.gz > SHA256SUMS
36+
cat SHA256SUMS
37+
2738
- name: Create Release
2839
uses: softprops/action-gh-release@v1
2940
with:

flake.nix

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
let
2020
pkgs = nixpkgs.legacyPackages.${system};
2121

22-
version = if (self ? rev) then "0.2.0-${self.shortRev}" else "0.2.0-dev";
22+
version = if (self ? shortRev) then self.shortRev else "dev";
2323

2424
# Static build targets (Zig cross-compilation)
2525
targets = {
@@ -81,16 +81,16 @@
8181
nativeBuildInputs = [ pkgs.gnutar pkgs.gzip ];
8282

8383
buildPhase = ''
84-
mkdir -p xenomorph-${version}/bin
85-
cp $src/bin/xenomorph xenomorph-${version}/bin/
86-
cp -r ${./.}/init xenomorph-${version}/ 2>/dev/null || true
87-
cp ${./.}/README.md xenomorph-${version}/ 2>/dev/null || echo "No README" > xenomorph-${version}/README.md
88-
cp ${./.}/LICENSE xenomorph-${version}/ 2>/dev/null || true
84+
mkdir -p xenomorph/bin
85+
cp $src/bin/xenomorph xenomorph/bin/
86+
cp -r ${./.}/init xenomorph/ 2>/dev/null || true
87+
cp ${./.}/README.md xenomorph/ 2>/dev/null || echo "No README" > xenomorph/README.md
88+
cp ${./.}/LICENSE xenomorph/ 2>/dev/null || true
8989
'';
9090

9191
installPhase = ''
9292
mkdir -p $out
93-
tar -czvf $out/xenomorph-${version}-${name}.tar.gz xenomorph-${version}
93+
tar -czvf $out/xenomorph-${name}.tar.gz xenomorph
9494
'';
9595
};
9696

0 commit comments

Comments
 (0)