@@ -37,27 +37,36 @@ jobs:
3737 echo "Successfully updated changelog in workspace:"
3838 head -n 10 debian/changelog
3939
40- - name : Build the application
40+ - name : Build Debian Package
41+ # This command now uses the changelog file that was just updated in the workspace
42+ run : dpkg-buildpackage -b -us -uc
43+
44+ - name : Build the standalone application
4145 run : |
4246 mkdir build
4347 cd build
4448 cmake ..
4549 make
4650
47- - name : Build Debian Package
48- # This command now uses the changelog file that was just updated in the workspace
49- run : dpkg-buildpackage -b -us -uc
50-
5151 - name : Prepare Release Artifacts
5252 run : |
5353 # Create a directory to store all assets for the release
5454 mkdir -p release_assets
5555
56- # Move the compiled executable
57- mv build/nepdate-cli release_assets/nepdate-cli
56+ # Move the compiled executable from the build/bin directory
57+ mv build/bin/ nepdate-cli release_assets/nepdate-cli
5858
59- # Move the generated .deb package
60- mv ../*.deb release_assets/
59+ # Find, move, and rename the generated .deb package
60+ ORIGINAL_DEB=$(find .. -maxdepth 1 -name "*.deb" | head -n 1)
61+ if [ -z "$ORIGINAL_DEB" ]; then
62+ echo "::error:: Debian package not found in parent directory."
63+ exit 1
64+ 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}"
68+ mv "$ORIGINAL_DEB" "release_assets/$NEW_DEB_NAME"
69+ echo "Renamed Debian package to: $NEW_DEB_NAME"
6170
6271 # Create a zip archive of the source code
6372 git archive -o release_assets/source-code-${{ github.ref_name }}.zip HEAD
0 commit comments