Skip to content

Commit ff4da43

Browse files
committed
ci update for release
1 parent 5c02870 commit ff4da43

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

.github/workflows/main.yml

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,49 +29,47 @@ jobs:
2929
export DEBEMAIL="[email protected]"
3030
export DEBFULLNAME="GitHub Actions"
3131
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 }}."
3639
3740
echo "Successfully updated changelog in workspace:"
3841
head -n 10 debian/changelog
3942
4043
- 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
4245
run: dpkg-buildpackage -b -us -uc
4346

44-
- name: Build the standalone application
45-
run: |
46-
mkdir build
47-
cd build
48-
cmake ..
49-
make
50-
5147
- name: Prepare Release Artifacts
5248
run: |
5349
# Create a directory to store all assets for the release
5450
mkdir -p release_assets
5551
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
5855
5956
# 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)
6158
if [ -z "$ORIGINAL_DEB" ]; then
6259
echo "::error:: Debian package not found in parent directory."
6360
exit 1
6461
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"
6866
mv "$ORIGINAL_DEB" "release_assets/$NEW_DEB_NAME"
6967
echo "Renamed Debian package to: $NEW_DEB_NAME"
7068
7169
# Create a zip archive of the source code
7270
git archive -o release_assets/source-code-${{ github.ref_name }}.zip HEAD
7371
74-
# Generate checksums for the .deb file
72+
# Generate checksums for the renamed .deb file
7573
cd release_assets
7674
for file in *.deb; do
7775
md5sum "$file" > "${file}.md5"

0 commit comments

Comments
 (0)