diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 15e1da1..f484276 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,8 +2,7 @@ name: Release on: release: - types: - - published + types: [published] jobs: pypi-publish: @@ -12,6 +11,7 @@ jobs: environment: release permissions: id-token: write + if: github.event.release.prerelease == false steps: - uses: actions/checkout@v4 - name: Set up Python @@ -28,3 +28,30 @@ jobs: run: python -m build - name: Publish uses: pypa/gh-action-pypi-publish@release/v1 + deb-package: + name: Build deb package + runs-on: ubuntu-24.04 + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + - name: Install dependencies + run: | + sudo apt-get update + sudo DEBIAN_FRONTEND=noninteractive apt-get install -y \ + --no-install-recommends build-essential devscripts debhelper equivs + sudo mk-build-deps -ir + - name: Create upstream tarball + run: | + version=$(git describe --tags | sed 's/^v//;s/-.*$//;s/_.*$//') + git archive --format=tar.gz --prefix="dotbackup-$version/" HEAD > \ + "../dotbackup_$version.orig.tar.gz" + - name: Build + run: debuild -us -uc -b && mv ../*.deb . + - uses: actions/upload-artifact@v4 + with: + name: deb + path: '*.deb' + - uses: softprops/action-gh-release@v2 + with: + files: '*.deb'