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 8a204ee commit 758afd1
Showing 1 changed file with 26 additions and 10 deletions.
36 changes: 26 additions & 10 deletions .github/workflows/build-deb-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,17 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0 # Fetch all history for all branches and tags
fetch-depth: 0 # Fetch full Git history and tags

- name: Set up the build environment
run: |
sudo apt-get update
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
libgtk-3-dev libglib2.0-dev gettext desktop-file-utils devscripts fakeroot lintian autopoint dh-make dh-autoreconf
- 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 2>/dev/null || echo "0.0.0")
TAGGED_COMMIT=$(git describe --tags --exact-match 2>/dev/null || echo "notag")
Expand All @@ -47,15 +46,32 @@ jobs:
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "DIST=$DIST" >> $GITHUB_ENV
- name: Prepare Debian Packaging
- name: Generate Debian Packaging Files
run: |
# 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_$VERSION
fi
echo -e '#!/usr/bin/make -f\n%:\n\tdh $@' > debian/rules
chmod +x debian/rules
echo "9" > debian/compat
echo "xnec2c ($VERSION) unstable; urgency=low\n\n * Initial release.\n\n -- Your Name <[email protected]> $(date -R)" > debian/changelog
cat > debian/control <<EOL
Source: xnec2c
Section: utils
Priority: optional
Maintainer: Your Name <[email protected]>
Build-Depends: debhelper (>= 9), autotools-dev, automake, autoconf, libtool, libgtk-3-dev, libglib2.0-dev, gettext, desktop-file-utils
Standards-Version: 3.9.6
Homepage: https://www.example.com

# Ensure the debian/rules file exists and is executable
chmod +x debian/rules
Package: xnec2c
Architecture: any
Depends: \${shlibs:Depends}, \${misc:Depends}
Description: A multi-threaded EM tool to model antenna near- and far-field radiation patterns.
Xnec2c is a high-performance multi-threaded electromagnetic simulation
package to model antenna near- and far-field radiation patterns for
Linux and UNIX operating systems.
EOL
fi

- name: Build the DEB package using debuild
run: |
Expand All @@ -66,8 +82,8 @@ jobs:
- name: Test DEB package
run: |
dpkg -i ../xnec2c_*.deb || true # Install DEB package
xnec2c -h # Run test
dpkg -i ../xnec2c_*.deb || true
xnec2c -h
- name: Upload the DEB package
uses: actions/upload-artifact@v2
Expand Down

0 comments on commit 758afd1

Please sign in to comment.