diff --git a/.chglog.yml b/.chglog.yml
new file mode 100644
index 0000000..cc31273
--- /dev/null
+++ b/.chglog.yml
@@ -0,0 +1,7 @@
+conventional-commits: false
+deb:
+    distribution: stable
+    urgency: stable
+debug: false
+owner: Benjamin Renard <brenard@zionetrix.net>
+package-name: aptly-publish
diff --git a/.forgejo/workflows/release.yaml b/.forgejo/workflows/release.yaml
new file mode 100644
index 0000000..04e158b
--- /dev/null
+++ b/.forgejo/workflows/release.yaml
@@ -0,0 +1,90 @@
+---
+name: Build and publish Debian package
+on: [create]
+jobs:
+  build:
+    runs-on: docker
+    container:
+      image: docker.io/brenard/nfpm:latest
+    steps:
+      - name: Check out repository code
+        uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
+      - name: Build Debian package
+        run: |
+          echo "${{ secrets.GPG_KEY }}" | base64 -d > key.gpg
+          VERSION="$( git describe --tags | sed 's/^[^0-9]*//' )"
+          yq eval '.version = strenv(VERSION)' nfpm.yaml -i
+          yq eval '.deb.signature.key_file = "key.gpg"' nfpm.yaml -i
+          yq eval '.maintainer = "${{ vars.MAINTAINER_NAME }} <${{ vars.MAINTAINER_EMAIL }}>"' nfpm.yaml -i
+          yq eval '.deb.distribution = "${{ vars.DEBIAN_CODENAME }}"' .chglog.yml -i
+          chglog init
+          mkdir dist
+          chglog format --template release -o dist/release_notes.md
+          nfpm -f nfpm.yaml package --packager deb --target dist
+      - name: Upload Debian package files
+        uses: actions/upload-artifact@v3
+        with:
+          name: dist
+          path: |
+            dist
+
+  publish-forgejo:
+    runs-on: docker
+    container:
+      image: docker.io/brenard/debian-python-deb:latest
+    needs:
+      - build
+    steps:
+      - name: Download Debian package files
+        uses: actions/download-artifact@v3
+        with:
+          name: dist
+
+      - name: Create the release
+        id: create-release
+        shell: bash
+        run: |
+          mkdir release
+          mv *.deb release/
+          mv check-*/check_* release/
+          md5sum release/* > md5sum.txt
+          sha512sum release/* > sha512sum.txt
+          mv md5sum.txt sha512sum.txt release/
+          {
+            echo 'release_note<<EOF'
+            cat release_notes.md | sed 's/"/\\"/g'
+            echo 'EOF'
+          } >> "$GITHUB_OUTPUT"
+
+      - name: Publish release on Forgejo
+        uses: actions/forgejo-release@v2
+        with:
+          direction: upload
+          url: https://gitea.zionetrix.net
+          token: ${{ secrets.forgejo_token }}
+          release-dir: release
+          release-notes: ${{ steps.create-release.outputs.release_note }}
+
+  publish-aptly:
+    runs-on: docker
+    container:
+      image: docker.io/brenard/aptly-publish:latest
+    needs:
+      - build
+    steps:
+      - name: "Download Debian package files"
+        uses: actions/download-artifact@v3
+        with:
+          name: dist
+
+      - name: "Publish Debian package on Aptly repository"
+        uses: https://gitea.zionetrix.net/bn8/aptly-publish@master
+        with:
+          api_url: ${{ vars.apt_api_url }}
+          api_username: ${{ vars.apt_api_username }}
+          api_password: ${{ secrets.apt_api_password }}
+          repo_name: ${{ vars.apt_repo_name }}
+          path: "./"
+          source_name: ${{ vars.apt_source_name }}
diff --git a/.gitignore b/.gitignore
index 3d0d534..444786d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
 *~
 /venv
 /dist
+/changelog.yml
+*.gpg
diff --git a/nfpm.yaml b/nfpm.yaml
new file mode 100644
index 0000000..42de359
--- /dev/null
+++ b/nfpm.yaml
@@ -0,0 +1,23 @@
+# yaml-language-server: $schema=https://nfpm.goreleaser.com/static/schema.json
+# vim: set ts=2 sw=2 tw=0 fo=cnqoj
+
+name: aptly-publish
+arch: all
+platform: linux
+version: 2025.2.1
+section: devel
+priority: optional
+depends:
+  - python3
+  - python3-requests
+  - python3-urllib3
+  - python3-debian
+maintainer: Benjamin Renard <brenard@zionetrix.net>
+description: Tool to publish one (or more) Debian package on a Aptly repository using its API
+homepage: https://gitea.zionetrix.net/bn8/aptly-publish
+license: GPL-3
+# Changelog YAML file, see: https://github.com/goreleaser/chglog
+changelog: changelog.yml
+contents:
+  - src: ./aptly-publish
+    dst: /usr/bin