Skip to content

1.24.0

1.24.0 #9

Workflow file for this run

name: Build deb package on release
on:
release:
types: [published]
jobs:
build-deb:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install deb build tools
run: |
sudo apt-get update -qq && \
sudo apt-get install -yqq build-essential devscripts debhelper fakeroot lintian
- name: Set up Debian packaging
run: |
APP_NAME=libbash.sh
# get release version without the "v"
VERSION="$(echo ${GITHUB_REF##*/} | sed 's/^v//')"
INSTALL_DIR=usr/lib/$APP_NAME
mkdir -p debian/source
# Create control file (adjust fields accordingly)
cat <<EOF > debian/control
Source: $APP_NAME
Section: libs
Priority: optional
Maintainer: Jean Prunneaux <jean@prunneaux.com>
Homepage: https://github.com/${{ github.repository }}
Build-Depends: debhelper-compat (= 13)
Standards-Version: 4.5.1
Package: $APP_NAME
Architecture: all
Depends: bash
Description: Library of useful Bash functions.
EOF
# Minimal rules file
cat <<EOF > debian/rules
#!/usr/bin/make -f
%:
dh \$@
EOF
chmod +x debian/rules
# Other required files
echo 1.0 > debian/source/format
# Changelog
dch --create -v "$VERSION" --package libbash.sh "Release $VERSION"
# Copy files instructions
cat <<EOF > debian/install
*.md usr/lib/$APP_NAME/
*.sh usr/lib/$APP_NAME/
docs usr/lib/$APP_NAME/
locales usr/lib/$APP_NAME/
EOF
- name: Build the deb package
run: |
# build without signing
dpkg-buildpackage -us -uc
- name: Upload .deb to release
uses: softprops/action-gh-release@v1
with:
files: ../libbash.sh_*.deb
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}