Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Automatically build package #53

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
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
51 changes: 51 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest

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

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y extra-cmake-modules qtbase5-dev libkf5coreaddons-dev \
libkf5i18n-dev libkf5xmlgui-dev libkf5doctools-dev libkf5kio-dev

- name: Configure
run: cmake -DCMAKE_INSTALL_PREFIX=./install

- name: Build
run: make install

- name: Package as .deb
run: |
mkdir -p package/DEBIAN
# Create control file for Debian package
echo "Package: k4dirstat" > package/DEBIAN/control
echo "Version: 1.0" >> package/DEBIAN/control
echo "Section: custom" >> package/DEBIAN/control
echo "Priority: optional" >> package/DEBIAN/control
echo "Architecture: all" >> package/DEBIAN/control
echo "Essential: no" >> package/DEBIAN/control
echo "Installed-Size: 1024" >> package/DEBIAN/control
echo "Maintainer: Mauro Druwel" >> package/DEBIAN/control
echo "Description: k4dirstat" >> package/DEBIAN/control
cp -r ./install/* package/
dpkg-deb --build package k4dirstat.deb

- name: Upload To Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./k4dirstat.deb
asset_name: k4dirstat.deb
asset_content_type: application/octet-stream