@@ -29,49 +29,47 @@ jobs:
29
29
export DEBEMAIL="[email protected] "
30
30
export DEBFULLNAME="GitHub Actions"
31
31
32
- # This command finds the last tag, derives the new version from the current tag,
33
- # and adds all commit subjects since the last tag to a new changelog entry.
34
- # The debian/changelog file is modified directly in the workspace for the build.
35
- gbp dch --auto --ignore-branch
32
+ # Get the version from the tag (e.g., v1.1.0 -> 1.1.0)
33
+ VERSION=${{ github.ref_name }}
34
+ VERSION=${VERSION#v}
35
+
36
+ # Explicitly create a new changelog entry with the correct version.
37
+ # This is more reliable than auto-detection.
38
+ dch --newversion "${VERSION}-1" --distribution "stable" "New release from tag ${{ github.ref_name }}."
36
39
37
40
echo "Successfully updated changelog in workspace:"
38
41
head -n 10 debian/changelog
39
42
40
43
- name : Build Debian Package
41
- # This command now uses the changelog file that was just updated in the workspace
44
+ # This command will now use the correct version from the updated changelog
42
45
run : dpkg-buildpackage -b -us -uc
43
46
44
- - name : Build the standalone application
45
- run : |
46
- mkdir build
47
- cd build
48
- cmake ..
49
- make
50
-
51
47
- name : Prepare Release Artifacts
52
48
run : |
53
49
# Create a directory to store all assets for the release
54
50
mkdir -p release_assets
55
51
56
- # Move the compiled executable from the build/bin directory
57
- mv build/bin/nepdate-cli release_assets/nepdate-cli
52
+ # Copy the executable that was built during the deb package creation.
53
+ # The standard location is in the debian/<package-name> directory.
54
+ cp debian/nepdate-cli/usr/bin/nepdate-cli release_assets/nepdate-cli
58
55
59
56
# Find, move, and rename the generated .deb package
60
- ORIGINAL_DEB=$(find .. -maxdepth 1 -name "*.deb" | head -n 1)
57
+ ORIGINAL_DEB=$(find .. -maxdepth 1 -name "nepdate-cli_ *.deb" | head -n 1)
61
58
if [ -z "$ORIGINAL_DEB" ]; then
62
59
echo "::error:: Debian package not found in parent directory."
63
60
exit 1
64
61
fi
65
- # Assumes format: package_version_arch.deb
66
- ARCH=$(basename "$ORIGINAL_DEB" | cut -d'_' -f3)
67
- NEW_DEB_NAME="nepdate-cli_${{ github.ref_name }}_${ARCH}"
62
+
63
+ # Reliably get the architecture from the package metadata
64
+ ARCH=$(dpkg-deb -f "$ORIGINAL_DEB" Architecture)
65
+ NEW_DEB_NAME="nepdate-cli_${{ github.ref_name }}_${ARCH}.deb"
68
66
mv "$ORIGINAL_DEB" "release_assets/$NEW_DEB_NAME"
69
67
echo "Renamed Debian package to: $NEW_DEB_NAME"
70
68
71
69
# Create a zip archive of the source code
72
70
git archive -o release_assets/source-code-${{ github.ref_name }}.zip HEAD
73
71
74
- # Generate checksums for the .deb file
72
+ # Generate checksums for the renamed .deb file
75
73
cd release_assets
76
74
for file in *.deb; do
77
75
md5sum "$file" > "${file}.md5"
0 commit comments