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

[helpers v2.1]: ynh_remove_systemd_config: Also remove the systemd service f… #1882

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
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
33 changes: 33 additions & 0 deletions .github/workflows/releases_from_tags.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Automatically write releases when tags appear

on:
push:
tags: [ "debian/*" ]


jobs:
pre-release:
name: Generate releases
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the changed files back to the repository.
contents: write

steps:
- name: Checkout code
uses: actions/checkout@master
with:
fetch-depth: 0 # Fetch all tags

- name: Patch tag name
id: patch-tag-name
run: echo "version=$(echo ${{ github.ref }} | sed 's|refs/tags/debian/||')" >> $GITHUB_OUTPUT

- name: Create Release for Tag
id: release_tag
uses: Akryum/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_name: YunoHost ${{ steps.patch-tag-name.outputs.version }}
tag_name: ${{ github.ref }}
6 changes: 5 additions & 1 deletion helpers/helpers.v1.d/systemd
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ ynh_add_systemd_config() {
systemctl daemon-reload
}

# Remove the dedicated systemd config
# Remove the dedicated systemd config, and if configured into YunoHost, removes the service.
#
# usage: ynh_remove_systemd_config [--service=service]
# | arg: -s, --service= - Service name (optionnal, $app by default)
Expand All @@ -62,6 +62,10 @@ ynh_remove_systemd_config() {
ynh_handle_getopts_args "$@"
local service="${service:-$app}"

if ynh_exec_warn_less yunohost service status "$app" >/dev/null; then
yunohost service remove "$app"
fi

local finalsystemdconf="/etc/systemd/system/$service.service"
if [ -e "$finalsystemdconf" ]; then
ynh_systemd_action --service_name=$service --action=stop
Expand Down
Loading