diff --git a/.github/workflows/deb-build.yml b/.github/workflows/deb-build.yml new file mode 100644 index 0000000..61b2c8f --- /dev/null +++ b/.github/workflows/deb-build.yml @@ -0,0 +1,78 @@ +name: Debian Package Build + +on: + pull_request: + branches: + - master + push: + branches: + - master + +env: + DEB_BUILD_DOCKER_IMAGE: "pitop/pi-top-os-deb-build" + DEB_BUILD_DOCKER_TAG: "latest" + CHANGELOG_AUTHOR_NAME: "pi-top" + CHANGELOG_AUTHOR_EMAIL: "deb-maintainers@pi-top.com" + +jobs: + build-debian-package: + runs-on: ubuntu-20.04 + steps: + - name: Checkout code + uses: actions/checkout@v2.2.0 + + - id: version + uses: docker://lpenz/ghaction-version-gen:0.3 + + - name: Add changelog entry for latest snapshot version + uses: pi-top/git-debian-changelog-bump-action@master + with: + release: false + author_name: ${{ env.CHANGELOG_AUTHOR_NAME }} + author_email: ${{ env.CHANGELOG_AUTHOR_EMAIL }} + snapshot_number: ${{ steps.version.outputs.distance }} + since: ${{ steps.version.outputs.tag_latest }} + + # We only want ARM builds. This step is here to provide the option of + # using a strategy matrix if additional builds (e.g. `arm64`) are desired + - name: Determine architecture to use from package info + # If architecture is 'all', then it can be compiled on host architecture + # All other pi-topOS cases require 'armhf' + run: | + target_architecture=amd64 + if grep '^Architecture:' debian/control | grep -q -v 'all'; then + target_architecture=armhf + fi + echo "TARGET_ARCHITECTURE=${target_architecture}" >> $GITHUB_ENV + + - name: Build Debian package + uses: pi-top/debian-package-build-action@master + with: + target_architecture: ${{ env.TARGET_ARCHITECTURE }} + docker_image: ${{ env.DEB_BUILD_DOCKER_IMAGE }}:${{ env.DEB_BUILD_DOCKER_TAG }} + build_directory: ./artifacts + + - name: Generate artifact name + run: | + echo "ARTIFACT_PREFIX=$(basename -s .dsc "$(find . -name "*.dsc")")" >> $GITHUB_ENV + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ env.ARTIFACT_PREFIX }}.deb + path: ./artifacts/*.deb + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ env.ARTIFACT_PREFIX }}.deb-src + path: ./artifacts/*.tar.xz + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ env.ARTIFACT_PREFIX }}.metadata + path: | + ./artifacts/** + !./artifacts/*.deb + !./artifacts/*.tar.xz diff --git a/.github/workflows/deb-release.yml b/.github/workflows/deb-release.yml new file mode 100644 index 0000000..aba35e8 --- /dev/null +++ b/.github/workflows/deb-release.yml @@ -0,0 +1,63 @@ +name: Create GitHub Release + +on: + workflow_dispatch: + branches: + - master + +env: + DEB_BUILD_DOCKER_IMAGE: "pitop/pi-top-os-deb-build" + DEB_BUILD_DOCKER_TAG: "latest" + +jobs: + release: + runs-on: ubuntu-20.04 + steps: + - name: Checkout code + uses: actions/checkout@v2.2.0 + + - id: version + uses: docker://lpenz/ghaction-version-gen:0.3 + + - name: Determine current and last tagged versions + run: | + sudo apt install -y dpkg-dev + echo "CURRENT_VERSION=$(dpkg-parsechangelog -Sversion)" >> $GITHUB_ENV + + - name: Confirm version is higher than last tagged version + if: steps.version.outputs.tag_latest != "" + run: dpkg --compare-versions ${{ env.CURRENT_VERSION }} gt ${{ steps.version.outputs.tag_latest }} + + - name: Determine architecture to use from package info + # If architecture is 'all', then it can be compiled on host architecture + # All other pi-topOS cases require 'armhf' + run: | + target_architecture=amd64 + if grep '^Architecture:' debian/control | grep -q -v 'all'; then + target_architecture=armhf + fi + echo "TARGET_ARCHITECTURE=${target_architecture}" >> $GITHUB_ENV + + - name: Build Debian package + uses: pi-top/debian-package-build-action@master + with: + target_architecture: ${{ env.TARGET_ARCHITECTURE }} + docker_image: ${{ env.DEB_BUILD_DOCKER_IMAGE }}:${{ env.DEB_BUILD_DOCKER_TAG }} + build_directory: ./artifacts + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: "dsc" + path: "./artifacts" + + - name: Create Release + uses: softprops/action-gh-release@v1 + with: + tag_name: "v${{ env.CURRENT_VERSION }}" + name: "v${{ env.CURRENT_VERSION }}" + draft: false + prerelease: false + files: ./artifacts/* + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/deb-update-changelog.yml b/.github/workflows/deb-update-changelog.yml new file mode 100644 index 0000000..8faf8d2 --- /dev/null +++ b/.github/workflows/deb-update-changelog.yml @@ -0,0 +1,43 @@ +name: Update Debian Package Changelog + +on: + workflow_dispatch: + branches: + - master + +env: + CHANGELOG_AUTHOR_NAME: "pi-top" + CHANGELOG_AUTHOR_EMAIL: "deb-maintainers@pi-top.com" + COMMIT_MESSAGE_PREFIX: "New changelog entry: v" + +jobs: + commit-updated-changelog: + runs-on: ubuntu-20.04 + steps: + - name: Checkout code + uses: actions/checkout@v2.2.0 + + - id: version + uses: docker://lpenz/ghaction-version-gen:0.3 + + - name: Add changelog entry for release version + uses: pi-top/git-debian-changelog-bump-action@master + with: + release: true + author_name: ${{ env.CHANGELOG_AUTHOR_NAME }} + author_email: ${{ env.CHANGELOG_AUTHOR_EMAIL }} + snapshot_number: ${{ steps.version.outputs.distance }} + since: ${{ steps.version.outputs.tag_latest }} + # Don't include previous changelog version bump commits in changelog + ignore_regex: | + ${{ env. COMMIT_MESSAGE_PREFIX }} + + - name: Determine current version + run: | + sudo apt install -y dpkg-dev + echo "CURRENT_VERSION=$(dpkg-parsechangelog -Sversion)" >> $GITHUB_ENV + + - uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: "${{ env.COMMIT_MESSAGE_PREFIX }}${{ env.CURRENT_VERSION }}" + branch: master diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..3812ee5 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,3 @@ +@Library("devops-jenkins-shared-library@master") _ + +buildOSPackage() diff --git a/README.md b/README.md index 8231a45..dbb2a8c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # raspi2png -Utility to take a snapshot of the raspberry pi screen and save it as a PNG file +Utility to take a snapshot of the Raspberry Pi screen and save it as a PNG file Usage: raspi2png [--pngname name] [--width ] [--height ] [--compression ] [--delay ] [--display ] [--stdout] [--help] diff --git a/debian/changelog b/debian/changelog index 7ee3e78..d77f070 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,31 @@ -raspi2png (0.1-1) unstable; urgency=low +raspi2png (1:0.1-1+nmu2) unstable; urgency=medium + + * Update package handling + * Add tar-ignore to debian/source/options + * Drop source/options + + -- pi-top Wed, 05 May 2021 13:22:32 +0000 + +raspi2png (1:0.1-1+nmu1) unstable; urgency=medium + + * Non-maintainer upload. + * Move back to non-native package + * Bump epoch version to allow update path + * Add hardening + + -- pi-top Tue, 04 May 2021 15:35:31 +0100 + +raspi2png (0.1+nmu1) unstable; urgency=medium + + * Non-maintainer upload. + * Native package + * compat level 12 + * Update build dependency: libpng12-dev --> libpng-dev + * Hard-code possible architectures to ARM only (armhf, arm64) + + -- pi-top Tue, 02 Mar 2021 11:48:37 +0000 + +raspi2png (0.1) unstable; urgency=medium * debianizing https://github.com/AndrewFromMelbourne/raspi2png diff --git a/debian/compat b/debian/compat deleted file mode 100644 index ec63514..0000000 --- a/debian/compat +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/debian/control b/debian/control index bbb5888..ed81eaa 100644 --- a/debian/control +++ b/debian/control @@ -2,11 +2,16 @@ Source: raspi2png Section: utils Priority: optional Maintainer: Przemyslaw Wegrzyn -Build-Depends: debhelper (>= 9), libpng12-dev, libraspberrypi-dev -Standards-Version: 3.9.5 +Build-Depends: + debhelper-compat (= 12), + libpng-dev, + libraspberrypi-dev, +Standards-Version: 4.5.1 Homepage: https://github.com/AndrewFromMelbourne/raspi2png/ Package: raspi2png -Architecture: any +Architecture: armhf arm64 Depends: ${shlibs:Depends}, ${misc:Depends} -Description: Utility to take a snapshot of the Raspberry Pi screen and save it as a PNG file. +Description: Raspberry Pi Screenshot Utility + Utility to take a snapshot of the Raspberry Pi screen and save it as a PNG + file. diff --git a/debian/raspi2png.lintian-overrides b/debian/raspi2png.lintian-overrides new file mode 100644 index 0000000..0059fbd --- /dev/null +++ b/debian/raspi2png.lintian-overrides @@ -0,0 +1 @@ +raspi2png: no-manual-page usr/bin/raspi2png diff --git a/debian/rules b/debian/rules index 54429cd..098338c 100755 --- a/debian/rules +++ b/debian/rules @@ -1,12 +1,5 @@ #!/usr/bin/make -f -# See debhelper(7) (uncomment to enable) -# output every command that modifies files on the build system. -#DH_VERBOSE = 1 +export DEB_BUILD_MAINT_OPTIONS = hardening=+all -DPKG_EXPORT_BUILDFLAGS = 1 -include /usr/share/dpkg/default.mk - -# main packaging script based on dh7 syntax %: dh $@ - diff --git a/raspi2png b/raspi2png deleted file mode 100755 index 7667297..0000000 Binary files a/raspi2png and /dev/null differ