From e2b934055404d7962d556cedaa41790d48c86ab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 19 Jan 2025 19:05:47 +0100 Subject: [PATCH 1/2] Add autoreleases from tags github actions --- .github/workflows/releases_from_tags.yaml | 33 +++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/releases_from_tags.yaml diff --git a/.github/workflows/releases_from_tags.yaml b/.github/workflows/releases_from_tags.yaml new file mode 100644 index 0000000000..a4f35f1c1e --- /dev/null +++ b/.github/workflows/releases_from_tags.yaml @@ -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/release-tag@v4.0.7 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + release_name: YunoHost ${{ steps.patch-tag-name.outputs.version }} + tag_name: ${{ github.ref }} From 156ef9bf227ad596d9f8e9427c17fa9a6a654d54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Wed, 21 Feb 2024 16:19:00 +0100 Subject: [PATCH 2/2] helpers: ynh_remove_systemd_config: Also remove the systemd service from YunoHost. Every app or almost will do that, because it doesn't make sense to remove the systemd config but not the associated yunohost configuration. This will clean up a bit the remove scripts. --- helpers/helpers.v1.d/systemd | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/helpers/helpers.v1.d/systemd b/helpers/helpers.v1.d/systemd index b569f3502b..38df15a1e9 100644 --- a/helpers/helpers.v1.d/systemd +++ b/helpers/helpers.v1.d/systemd @@ -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) @@ -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