Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Added Github Actions #3

Merged
merged 1 commit into from
Feb 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/build-deb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build and Release .deb Package

on:
push:
tags:
- 'v*.*.*' # Trigger only on tags matching this pattern

jobs:
build-deb:
runs-on: ubuntu-24.04
permissions:
contents: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

# Compute the version by using github.ref_name (e.g., "v0.2.1")
- name: Compute Version
id: version
env:
REF_NAME: ${{ github.ref_name }}
run: |
# Remove the leading "v" from the ref name (e.g., v0.2.1 becomes 0.2.1)
VERSION=${REF_NAME#v}
echo "Computed version: $VERSION"
echo "build_version=$VERSION" >> $GITHUB_OUTPUT

- name: Build .deb package
env:
BUILD_VERSION: ${{ steps.version.outputs.build_version }}
run: |
echo "Using BUILD_VERSION: $BUILD_VERSION"
chmod +x build_deb.sh
./build_deb.sh

- name: Upload .deb to GitHub Releases
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
files: pysieved_${{ steps.version.outputs.build_version }}.deb
name: Pysieved ${{ github.ref_name }}
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,8 @@ All notable changes to this project will be documented in this file.
* Fixed imports in `./pysieved/main.py`
* Fixed imports in `./pysieved/plugins/htpasswd.py`
* Updated `./.gitignore`, to ignore locally built debian packages

#### 2025-02-19

* Added `./.github/workflows/build-deb.yml` file to build and release debian package with Github Actions
* Updated `./debian/build_deb.sh` script to automatically update the debian changelog before building the debian package
7 changes: 5 additions & 2 deletions build_deb.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#!/bin/bash

export BUILD_VERSION=0.2.0
export BUILD_VERSION=${BUILD_VERSION:-0.2.0}

docker build -t pysieved-deb-builder .
docker run --name pysieved-builder pysieved-deb-builder dpkg-buildpackage -b -us -uc -rfakeroot -tc
docker run --name pysieved-builder pysieved-deb-builder bash -c "
dch --newversion '${BUILD_VERSION}' --distribution unstable --urgency medium 'Autogenerated version' &&
dpkg-buildpackage -b -us -uc -rfakeroot -tc
"
docker cp pysieved-builder:/root/pysieved_${BUILD_VERSION}_amd64.deb pysieved_${BUILD_VERSION}.deb
docker rm -f pysieved-builder