Skip to content

Commit

Permalink
github: fix build-deb-packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Wheeler committed Aug 14, 2024
1 parent 8c36042 commit 3e0ceaa
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions .github/workflows/build-deb-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,33 @@ jobs:
sudo apt-get install -y build-essential autoconf automake libtool \
libgtk-3-dev libglib2.0-dev gettext desktop-file-utils devscripts fakeroot lintian autopoint dh-make
- name: Determine version and dist
id: version
run: |
# Get the most recent tag, and check if the latest commit is tagged
LATEST_TAG=$(git describe --tags --abbrev=0)
TAGGED_COMMIT=$(git describe --tags --exact-match 2>/dev/null || echo "notag")
if [ "$TAGGED_COMMIT" = "notag" ]; then
VERSION="${LATEST_TAG}+"
DIST="-git"
else
VERSION=$LATEST_TAG
DIST=""
fi
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "DIST=$DIST" >> $GITHUB_ENV
- name: Prepare Debian Packaging
run: |
# Initialize debian directory structure if it doesn't exist
# Initialize debian directory structure with the correct version if it doesn't exist
if [ ! -d "debian" ]; then
dh_make --createorig -y --single --native --packagename xnec2c_1.0
dh_make --createorig -y --single --native --packagename xnec2c_$VERSION
fi
# Optionally modify the debian/changelog file if needed
echo "xnec2c (1.0) unstable; urgency=low" > debian/changelog
echo " * Initial release." >> debian/changelog
echo " -- Your Name <[email protected]> $(date -R)" >> debian/changelog
# Ensure the debian/rules file exists and is executable
chmod +x debian/rules
- name: Build the DEB package using debuild
run: |
Expand Down

0 comments on commit 3e0ceaa

Please sign in to comment.