File tree Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Original file line number Diff line number Diff line change 2121 commonBuildInputs = with pkgs ; [
2222 gcc
2323 pkg-config
24+ git-cliff
2425
2526 # Build systems
2627 cmake
Original file line number Diff line number Diff line change @@ -24,10 +24,42 @@ if [ -z "$GITHUB_TOKEN" ]; then
2424
2525fi
2626
27+ # Make sure submodules are up to date
28+ git submodule update --init --recursive
29+
30+ # Check that no uncommitted changes exist
31+ if [ -n " $( git status --porcelain) " ]; then
32+ echo " Uncommitted changes exist. Please commit or stash them before creating a release."
33+ exit 1
34+ fi
35+
2736git cliff -o CHANGELOG.md --tag $VERSION --github-token $GITHUB_TOKEN
2837git add CHANGELOG.md
2938git commit -m " chore: Release $VERSION "
3039git tag $VERSION -m " Release $VERSION "
3140git push origin main
3241git push origin $VERSION
33- gh release create $VERSION -t $VERSION --generate-notes -d
42+
43+ # Create tarball with submodules included
44+ echo " Creating release tarball with submodules..."
45+ TMPDIR=$( mktemp -d)
46+ ARCHIVE_NAME=" codspeed-cpp-${VERSION} "
47+ TARBALL_NAME=" ${ARCHIVE_NAME} .tar.gz"
48+
49+ # Create main archive
50+ git archive --prefix=" ${ARCHIVE_NAME} /" --format=tar HEAD | \
51+ (cd " $TMPDIR " && tar xf -)
52+
53+ # Add submodule content
54+ git submodule foreach --recursive " git archive --prefix=${ARCHIVE_NAME} /\$ path/ --format=tar HEAD | (cd $TMPDIR && tar xf -)"
55+
56+ # Create final tarball
57+ (cd " $TMPDIR " && tar czf " $TMPDIR /$TARBALL_NAME " " $ARCHIVE_NAME " )
58+
59+ echo " Tarball created at: $TMPDIR /$TARBALL_NAME "
60+
61+ # Create GitHub release with the tarball
62+ gh release create $VERSION -t $VERSION --generate-notes -d " $TMPDIR /$TARBALL_NAME "
63+
64+ # Cleanup
65+ rm -rf " $TMPDIR "
You can’t perform that action at this time.
0 commit comments