Skip to content

Commit

Permalink
Start a workflow to run on pushes
Browse files Browse the repository at this point in the history
This workflow attempts to build a Debian changelog from the history
since the last tag (one 'version' per commit), and then does a `debuild`
without signing.  The (unsigned) results are uploaded as an artifact of
the workflow run.

On the changelog: The Debian package version number is taken from the
changelog.  We need to make at least one changelog entry, as the package
version will be taken from that.  We use version 99, plus the commit
date and tag.  That ensures version numbers continue to increase as we
move forward in time, while also containing the commit ID in the version
number.  If we ever do a proper release of a version above 99, this will
break!
  • Loading branch information
akkornel committed Apr 17, 2024
1 parent 35e2594 commit 196c24e
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: 'Build Packages'

on: push

permissions:
contents: read

jobs:
Package:
name: Create Package for Branch
runs-on: ubuntu-latest
steps:
- id: sysprep
name: Prep system for dev work
run: |
sudo apt-get update
sudo apt-get install -y build-essential devscripts
- id: checkout
name: Checkout Repo
uses: actions/checkout@v4
with:
path: "source"
fetch-depth: 0

- id: get_tag
name: Get most recent tag
run: |
cd source;
echo "tag=$(git describe --tags --abbrev=0)" >> "$GITHUB_OUTPUT"
- id: make_changelogs
name: Make changelog entries
env:
start: ${{ steps.get_tag.outputs.tag }}
run: |
cd source;
for commit in $(git log --format="%h" ${start}..); do
echo "Adding changelog entry for commit ${commit}";
EMAIL=$(git log -1 --pretty=%ae ${commit}) \
NAME=$(git log -1 --pretty=%an ${commit}) \
dch --newversion \
"$(git log -1 --date=format:%Y%m%d%H%M --pretty=99~git%cd.%h ${commit})" \
"$(git log -1 --pretty=%s ${commit})";
done
- name: Build package (without signing)
run: |
cd source && \
debuild -us -uc
- name: Upload Build Result as artifact
uses: actions/[email protected]
with:
name: package
path: docker-image-cleanup*
if-no-files-found: error

0 comments on commit 196c24e

Please sign in to comment.