Skip to content

Commit

Permalink
Merge pull request #9 from quickemu-project/debian
Browse files Browse the repository at this point in the history
  • Loading branch information
popey authored May 14, 2024
2 parents 7bf045b + fa8b173 commit 952acba
Show file tree
Hide file tree
Showing 8 changed files with 204 additions and 0 deletions.
110 changes: 110 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: Publish Release 🏷️

on:
push:
tags:
- "v?[0-9]+.[0-9]+.[0-9]+*"
workflow_dispatch:
inputs:
tag:
description: "The existing tag to publish"
type: "string"
required: true

jobs:
version-check:
name: "Check versions ⚖️"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "Compare App and Git versions 🟰"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
APP_VERSION=$(grep "^readonly VERSION" quicktest | cut -d'"' -f2)
GIT_VERSION=$(git describe --tags | cut -d'-' -f1)
echo "App version: ${REL_VERSION}"
echo "Git version: ${GIT_VERSION}"
if [ "${APP_VERSION}" != "${GIT_VERSION}" ]; then
echo "ERROR! Version mismatch.";
exit 1
fi
draft-release:
needs: [version-check]
name: "Draft Release 📥️"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Create release ${{ github.ref }} as a draft
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "${{ github.ref }}" --draft --generate-notes
build-release:
needs: [draft-release]
name: "Build Release 👨‍🔧"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Build and Upload .deb
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
sudo apt-get -y update
sudo apt-get -y install debhelper devscripts
REL_VER=$(grep "^readonly VERSION" quicktest | cut -d'"' -f2)
rm debian/changelog
dch --package quicktest --newversion="${REL_VER}-1" --distribution=unstable "New upstream release." --create
dpkg-buildpackage --build=binary --no-check-builddeps --compression=gzip
gh release upload "${{ github.ref }}" "../quicktest_${REL_VER}-1_all.deb" --clobber
publish-release:
needs: [build-release]
name: "Publish Release 📤️"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Publish release ${{ github.ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [ "$(gh release view "${{ github.ref }}" --json assets --template '{{len .assets}}')" -lt 0 ]; then
exit 1
fi
gh release edit "${{ github.ref }}" --draft=false
publish-ppa:
needs: [version-check]
name: "Publish PPA 📦️"
runs-on: ubuntu-22.04
steps:
- name: "Checkout 🥡"
uses: actions/checkout@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Import gpg key 🔑"
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.PPA_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PPA_GPG_PASSPHRASE }}
- name: "Install dependencies 💾"
run: |
sudo apt-get -y update
sudo apt-get -y install debhelper-compat distro-info dput devscripts
- name: "Upload to PPA ⤴️"
env:
DEBEMAIL: ${{ secrets.DEBEMAIL }}
DEBFULLNAME: ${{ secrets.DEBFULLNAME }}
run: |
REL_VER=$(grep "^readonly VERSION" quicktest | cut -d'"' -f2)
STAMP=$(date +%y%j.%H%M)
for CODENAME in $(distro-info --supported); do
rm debian/changelog
dch --package quicktest --newversion="${REL_VER}-1~${CODENAME}${STAMP}" --distribution=${CODENAME} "New upstream release." --create
dpkg-buildpackage -d -S -sa
dput ppa:flexiondotorg/quickemu ../quicktest_${REL_VER}-1~${CODENAME}${STAMP}_source.changes
done
5 changes: 5 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
quicktest (0.1.0-1) unstable; urgency=medium

* Initial release.

-- Martin Wimpress <[email protected]> Tue, 14 May 2024 11:22:33 +0000
30 changes: 30 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Source: quicktest
Section: utils
Priority: optional
Maintainer: Martin Wimpress <[email protected]>
Build-Depends:
debhelper-compat (= 12),
Standards-Version: 4.5.1
Homepage: https://github.com/quickemu-project/quicktest
Vcs-Browser: https://github.com/quickemu-project/quicktest
Vcs-Git: https://github.com/quickemu-project/quicktest.git
Rules-Requires-Root: no

Package: quicktest
Architecture: all
Depends:
coreutils,
ffmpeg,
grep,
imagemagick,
quickemu,
procps,
socat,
tesseract-ocr,
util-linux,
${misc:Depends},
${shlibs:Depends},
Description: Quickly and automatically test systems inside Quickemu virtual machines
Quicktest runs test cases automatically in Qemu virtual machines using Quickemu
by injecting keypresses and reading the screen with Tesseract OCR.
.
45 changes: 45 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: quicktest
Upstream-Contact: Alan Pope <[email protected]>
Source: https://github.com/quickemu-project/quicktest

Files: *
Copyright: 2024 Alan Pope <[email protected]>
License: MIT
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

# If you want to use GPL v2 or later for the /debian/* files use
# the following clauses, or change it to suit. Delete these two lines
Files: debian/*
Copyright: 2024 Martin Wimpress <[email protected]>
License: GPL-2+
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>
.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
1 change: 1 addition & 0 deletions debian/install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
quicktest usr/bin
7 changes: 7 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/make -f

%:
dh $@

override_dh_builddeb:
dh_builddeb -- -Zgzip
1 change: 1 addition & 0 deletions debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (native)
5 changes: 5 additions & 0 deletions debian/watch
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
version=4

opts="filenamemangle=s%(?:.*?)?v?(\d[\d.]*)\.tar\.gz%quicktest-$1.tar.gz%" \
https://github.com/quickemu/quicktest/tags \
(?:.*?/)?v?(\d[\d.]*)\.tar\.gz

0 comments on commit 952acba

Please sign in to comment.