forked from miracle2k/pysieved
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from noris-network/github_actions
Added Github Actions Workflow to build debian package and export .deb file in a new release
- Loading branch information
Showing
3 changed files
with
55 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|