|
| 1 | +name: Make Debian Package |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +jobs: |
| 9 | + build-dsc: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + steps: |
| 12 | + - name: Checkout repository |
| 13 | + uses: actions/checkout@v4 |
| 14 | + |
| 15 | + - name: Install build dependencies |
| 16 | + run: | |
| 17 | + sudo apt-get update |
| 18 | + sudo apt-get install -y \ |
| 19 | + build-essential \ |
| 20 | + debhelper \ |
| 21 | + devscripts \ |
| 22 | + dh-python \ |
| 23 | + dh-sequence-python3 \ |
| 24 | + pybuild-plugin-pyproject \ |
| 25 | + fakeroot \ |
| 26 | + python3-all \ |
| 27 | + python3-poetry-core |
| 28 | +
|
| 29 | + - name: Create upstream tarball |
| 30 | + run: | |
| 31 | + DEB_VERSION=$(dpkg-parsechangelog -SVersion) |
| 32 | + UPSTREAM_VERSION=${DEB_VERSION%%-*} |
| 33 | + git archive --format=tar.gz \ |
| 34 | + --output=../kci-dev_${UPSTREAM_VERSION}.orig.tar.gz \ |
| 35 | + --prefix=kci-dev-${UPSTREAM_VERSION}/ \ |
| 36 | + HEAD |
| 37 | +
|
| 38 | + - name: Build Debian package |
| 39 | + run: debuild -S -us -uc --lintian-opts --profile debian |
| 40 | + |
| 41 | + - name: Collect Debian artifacts for development |
| 42 | + run: | |
| 43 | + mkdir -p artifacts |
| 44 | + shopt -s nullglob |
| 45 | + for file in ../kci-dev_*; do |
| 46 | + mv "$file" artifacts/ |
| 47 | + done |
| 48 | +
|
| 49 | + - name: Upload Debian artifacts for development |
| 50 | + uses: actions/upload-artifact@v4 |
| 51 | + with: |
| 52 | + name: kci-dev-debian-source |
| 53 | + path: artifacts/ |
| 54 | + |
| 55 | + - name: Upload Debian source to GitHub Release on new tag |
| 56 | + if: startsWith(github.ref, 'refs/tags/') |
| 57 | + uses: softprops/action-gh-release@v2 |
| 58 | + env: |
| 59 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 60 | + with: |
| 61 | + tag_name: ${{ github.ref_name }} |
| 62 | + files: | |
| 63 | + ../kci-dev_*.dsc |
| 64 | + ../kci-dev_*.orig.tar.* |
| 65 | + ../kci-dev_*debian.tar.* |
| 66 | + ../kci-dev_*_source.buildinfo |
| 67 | + ../kci-dev_*_source.changes |
0 commit comments