|
22 | 22 | GOOS=linux GOARCH=amd64 go build -o eldim-${{ steps.version.outputs.VERSION }}-linux-amd64 . |
23 | 23 | GOOS=linux GOARCH=arm64 go build -o eldim-${{ steps.version.outputs.VERSION }}-linux-arm64 . |
24 | 24 | GOOS=darwin GOARCH=arm64 go build -o eldim-${{ steps.version.outputs.VERSION }}-darwin-arm64 . |
| 25 | + - name: Build .deb packages |
| 26 | + run: | |
| 27 | + VERSION="${{ steps.version.outputs.VERSION }}" |
| 28 | + # Strip leading 'v' for the .deb version field |
| 29 | + DEB_VERSION="${VERSION#v}" |
| 30 | +
|
| 31 | + for ARCH in amd64 arm64; do |
| 32 | + PKG="eldim-${VERSION}-linux-${ARCH}-deb" |
| 33 | +
|
| 34 | + # Create directory structure |
| 35 | + mkdir -p "${PKG}/DEBIAN" |
| 36 | + mkdir -p "${PKG}/usr/bin" |
| 37 | + mkdir -p "${PKG}/etc/eldim" |
| 38 | + mkdir -p "${PKG}/lib/systemd/system" |
| 39 | + mkdir -p "${PKG}/usr/share/doc/eldim" |
| 40 | +
|
| 41 | + # Install binary |
| 42 | + cp "eldim-${VERSION}-linux-${ARCH}" "${PKG}/usr/bin/eldim" |
| 43 | + chmod 755 "${PKG}/usr/bin/eldim" |
| 44 | +
|
| 45 | + # Install config files |
| 46 | + cp eldim.yml "${PKG}/etc/eldim/eldim.yml" |
| 47 | + cp clients.yml "${PKG}/etc/eldim/clients.yml" |
| 48 | +
|
| 49 | + # Install systemd service |
| 50 | + cp eldim.service "${PKG}/lib/systemd/system/eldim.service" |
| 51 | +
|
| 52 | + # Install documentation |
| 53 | + cp README.md "${PKG}/usr/share/doc/eldim/" |
| 54 | + cp LICENSE "${PKG}/usr/share/doc/eldim/" |
| 55 | + cp docs/api.md "${PKG}/usr/share/doc/eldim/" |
| 56 | + cp docs/config.md "${PKG}/usr/share/doc/eldim/" |
| 57 | + cp docs/metrics.md "${PKG}/usr/share/doc/eldim/" |
| 58 | +
|
| 59 | + # DEBIAN control file |
| 60 | + sed -e "s/VERSION/${DEB_VERSION}/" -e "s/ARCHITECTURE/${ARCH}/" \ |
| 61 | + debian/control.template > "${PKG}/DEBIAN/control" |
| 62 | +
|
| 63 | + # DEBIAN conffiles |
| 64 | + cp debian/conffiles "${PKG}/DEBIAN/conffiles" |
| 65 | +
|
| 66 | + # DEBIAN maintainer scripts |
| 67 | + cp debian/postinst "${PKG}/DEBIAN/postinst" |
| 68 | + cp debian/prerm "${PKG}/DEBIAN/prerm" |
| 69 | + cp debian/postrm "${PKG}/DEBIAN/postrm" |
| 70 | + chmod 755 "${PKG}/DEBIAN/postinst" |
| 71 | + chmod 755 "${PKG}/DEBIAN/prerm" |
| 72 | + chmod 755 "${PKG}/DEBIAN/postrm" |
| 73 | +
|
| 74 | + # Build the .deb and clean up the staging directory |
| 75 | + dpkg-deb --build "${PKG}" "eldim-${VERSION}-linux-${ARCH}.deb" |
| 76 | + rm -rf "${PKG}" |
| 77 | + done |
25 | 78 | - name: Create Release |
26 | 79 | uses: softprops/action-gh-release@v2 |
27 | 80 | with: |
|
0 commit comments