-
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.
* Add workflows for automate building * add deb package builder * move sample script * add daemon handler
- Loading branch information
1 parent
831a7ec
commit a42e9ad
Showing
10 changed files
with
293 additions
and
6 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,70 @@ | ||
on: | ||
push: | ||
# Sequence of patterns matched against refs/tags | ||
tags: | ||
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
|
||
workflow_dispatch: | ||
|
||
name: Build Release | ||
|
||
jobs: | ||
deb-package: | ||
name: build DEB-Package | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install dependencies | ||
run: sudo apt update && sudo apt install debhelper -y | ||
|
||
- name: Build | ||
run: ./buildpackage.sh | ||
|
||
- name: Copy artifacts | ||
run: mkdir archives && cp ../*.* ./archives | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: deb-package | ||
path: archives/* | ||
|
||
github-release: | ||
needs: deb-package | ||
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | ||
name: GitHub Release | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Download artifact | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: deb-package | ||
|
||
- name: Extract current changes | ||
run: cat *.changes | sed '0,/^Changes:$/d' | sed '/Checksums.*/Q' | sed '1,2d' | tail >> ./current-changes | ||
|
||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
body_path: ./current-changes | ||
|
||
- name: Delete current changes file | ||
run: rm ./current-changes | ||
|
||
- name: Upload Release Assets | ||
id: upload-release-assets | ||
uses: dwenegar/upload-release-assets@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
release_id: ${{ steps.create_release.outputs.id }} | ||
assets_path: . |
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,4 @@ | ||
#!/bin/bash | ||
|
||
# build the debian package | ||
dpkg-buildpackage -rfakeroot -tc -sa -us -uc -I".directory" -I".git" -I"buildpackage.sh" |
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,5 @@ | ||
tripoli (0.0.1~rc1) bullseye; urgency=medium | ||
|
||
* First release for version 0.0.1 | ||
|
||
-- hermanntoast <[email protected]> Tue, 24 May 2022 18:12:46 +0200 |
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 @@ | ||
5 |
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,12 @@ | ||
Source: tripoli | ||
Section: admin | ||
Priority: optional | ||
Maintainer: hermanntoast <[email protected]> | ||
Build-Depends: debhelper (>= 4.0.0), fakeroot | ||
|
||
Package: tripoli | ||
Architecture: all | ||
Depends: python3 | ||
Homepage: hermann-toast.de | ||
Recommends: | ||
Description: Create XFCE Shell extentions |
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,23 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
case "$1" in | ||
install|configure) | ||
echo "Creating directories und copy samples..." | ||
mkdir -p ~/.config/tripoli/ | ||
mkdir -p ~/.config/tripoli/log/ | ||
cp -f /usr/share/tripoli/samples/sampleScript.sh ~/.config/tripoli/ | ||
echo "Creating startup script for all users..." | ||
echo "#!/bin/sh" > /etc/profile.d/tripoli.sh | ||
echo "python3 /usr/share/tripoli/tripoli.py 2>&1 > /dev/null &" >> /etc/profile.d/tripoli.sh | ||
chmod +x /etc/profile.d/tripoli.sh | ||
;; | ||
upgrade|abort-upgrade) | ||
;; | ||
*) | ||
echo "postinst called with unknown argument \`$1'" >&2 | ||
exit 0 | ||
;; | ||
esac | ||
|
||
exit 0 |
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,112 @@ | ||
#!/usr/bin/make -f | ||
# Sample debian/rules that uses debhelper. | ||
# GNU copyright 1997 by Joey Hess. | ||
# | ||
# This version is for a hypothetical package that builds an | ||
# architecture-dependant package, as well as an architecture-independent | ||
# package. | ||
|
||
# Uncomment this to turn on verbose mode. | ||
#export DH_VERBOSE=1 | ||
|
||
# This is the debhelper compatibility version to use. | ||
export DH_COMPAT=5 | ||
|
||
#ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) | ||
# CFLAGS += -g | ||
#endif | ||
#ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) | ||
# INSTALL_PROGRAM += -s | ||
#endif | ||
|
||
configure: configure-stamp | ||
configure-stamp: | ||
dh_testdir | ||
# Add here commands to configure the package. | ||
|
||
touch configure-stamp | ||
|
||
|
||
build-arch: configure-stamp build-arch-stamp | ||
build-arch-stamp: | ||
dh_testdir | ||
|
||
# Add here command to compile/build the package. | ||
#$(MAKE) | ||
|
||
touch build-arch-stamp | ||
|
||
build-indep: configure-stamp build-indep-stamp | ||
build-indep-stamp: | ||
dh_testdir | ||
|
||
# Add here command to compile/build the arch indep package. | ||
# It's ok not to do anything here, if you don't need to build | ||
# anything for this package. | ||
|
||
touch build-indep-stamp | ||
|
||
build: build-arch build-indep | ||
|
||
clean: clean1 | ||
clean1: | ||
dh_testdir | ||
dh_testroot | ||
rm -f build-indep-stamp build-arch-stamp configure-stamp | ||
|
||
# Add here commands to clean up after the build process. | ||
#-$(MAKE) clean | ||
|
||
dh_clean | ||
|
||
|
||
install: DH_OPTIONS= | ||
install: build | ||
dh_testdir | ||
dh_testroot | ||
dh_prep | ||
dh_installdirs | ||
|
||
# Add here commands to install the package. | ||
dh_install | ||
# fixing default not being installed | ||
mkdir -p debian/tripoli | ||
rsync -avr --exclude='.installed' usr debian/tripoli | ||
|
||
|
||
# Build architecture-independent files here. | ||
# Pass -i to all debhelper commands in this target to reduce clutter. | ||
binary-indep: build install | ||
dh_testdir | ||
dh_testroot | ||
dh_installdirs | ||
dh_installdebconf | ||
dh_installdocs | ||
# dh_installexamples -i | ||
# dh_installmenu -i | ||
dh_installlogrotate -i | ||
# dh_installemacsen -i | ||
# dh_installpam -i | ||
# dh_installmime -i | ||
dh_installinit -i | ||
dh_installcron -i | ||
# dh_installman -i | ||
# dh_installinfo -i | ||
# dh_undocumented -i | ||
dh_installchangelogs | ||
dh_link | ||
dh_compress | ||
dh_fixperms | ||
dh_installdeb | ||
# dh_perl -i | ||
dh_gencontrol | ||
dh_md5sums | ||
dh_builddeb | ||
|
||
# Build architecture-dependent files here. | ||
binary-arch: install | ||
# We have nothing to do by default. | ||
|
||
|
||
binary: binary-indep binary-arch | ||
.PHONY: build clean binary-indep binary-arch binary install configure clean1 |
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,58 @@ | ||
#!/bin/bash | ||
|
||
function start() { | ||
if isRunning; then | ||
echo "Tripoli is already running!" | ||
else | ||
echo -n "Starting tripoli... " | ||
python3 /usr/share/tripoli/tripoli.py 2>&1 > /dev/null & | ||
echo "[OK]" | ||
fi | ||
} | ||
|
||
function stop() { | ||
if isRunning; then | ||
echo -n "Stopping tripoli... " | ||
ps -aux | grep python | grep tripoli | awk '{print $2}' | xargs kill | ||
echo "[OK]" | ||
else | ||
echo "Tripoli is not running!" | ||
fi | ||
} | ||
|
||
function isRunning() { | ||
if [ $(ps -aux | grep python | grep tripoli | wc -l) -gt 0 ]; then | ||
return 0 | ||
else | ||
return 1 | ||
fi | ||
} | ||
|
||
function getPID() { | ||
return $(ps -aux | grep python | grep tripoli | awk '{print $2}') | ||
} | ||
|
||
case "$1" in | ||
start) | ||
start | ||
;; | ||
stop) | ||
stop | ||
;; | ||
restart) | ||
stop | ||
sleep 2 | ||
start | ||
;; | ||
status) | ||
if isRunning; then | ||
getPID | ||
echo "Tripoli is running with pid $?" | ||
else | ||
echo "Tripoli is not running!" | ||
fi | ||
;; | ||
*) | ||
echo "Option not known! Use start, stop, restart or status!" | ||
;; | ||
esac |
File renamed without changes.
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