Compare commits

...

29 Commits

Author SHA1 Message Date
zenobit 05fa5bb7df
Merge 0143416856 into 51cbd207fe 2024-05-03 23:03:34 +02:00
zen0bit 51cbd207fe Sort os_support 2024-05-03 18:01:40 +01:00
zen0bit e5468e47c5 fix: daily-live not shown in checks 2024-05-03 18:01:14 +01:00
Martin Wimpress e4c612118e refactor: update and simplify test-quickget.yml 2024-05-03 18:00:41 +01:00
Martin Wimpress 79c0486aad style: white space clean up in test-quickget.yml 2024-05-03 18:00:41 +01:00
Martin Wimpress 182a0c11e7 ci: retain test result for default period 2024-05-03 18:00:41 +01:00
Martin Wimpress 07f6205294 ci: add version checking to publish-release.yml. close #1128 2024-05-03 18:00:41 +01:00
Martin Wimpress f03d830c30 ci: fix upload-artifacts. closes #1154 2024-05-03 18:00:41 +01:00
Martin Wimpress 2f6ab18812 refactor: update lint-shellcheck to use ludeeus/action-shellcheck. close #909 close #979 close #980 2024-05-03 18:00:41 +01:00
Martin Wimpress 7c892c9dc2 ci: refactor publish-release.yml
All release operations in a single workflow
2024-05-03 18:00:41 +01:00
Martin Wimpress 945933d5f4 fix: exit the tests correctly 2024-05-03 18:00:41 +01:00
Martin Wimpress dcbfce86d2 ci :rename workflows 2024-05-03 18:00:41 +01:00
Martin Wimpress 4abd7231c9 style: white space clean up 2024-05-03 18:00:41 +01:00
Martin Wimpress 19539d7b31 ci: use quickget long arguments for readability 2024-05-03 18:00:41 +01:00
Martin Wimpress 5da3942278 ci: update workflow names 2024-05-03 18:00:41 +01:00
Martin Wimpress ed91628c29 ci :update quickget-tests job names 2024-05-03 18:00:41 +01:00
Martin Wimpress 590bc24347 ci :remove obsolete neofetch install 2024-05-03 18:00:41 +01:00
Martin Wimpress 4e2b553972 ci: run all tests on ubuntu-22.04 2024-05-03 18:00:41 +01:00
Martin Wimpress e35f11b25e ci: update publish-flakehub.yml 2024-05-03 18:00:41 +01:00
Martin Wimpress b085bebfbe style: update usage/help for quickemu and quickget 2024-05-03 18:00:41 +01:00
zen0bit 6490d48bf9 refactor: update help_message(). closes #1148 2024-05-03 18:00:41 +01:00
zen0bit 88d61eae4e ci: misc fixes 2024-05-03 18:00:41 +01:00
zen0bit b7ff9f90db ci: Improve quickget tests 2024-05-03 18:00:41 +01:00
Martin Wimpress 9b2eeb6f93 ci: remove obsolete -ca and -ua arguments. closes #1146 2024-05-03 18:00:41 +01:00
zen0bit 88d731895a ci: save failed.txt and compare URLs/All supported 2024-05-03 18:00:41 +01:00
zen0bit 5a07cc5d92 ci: count lines and output counts in the logs 2024-05-03 18:00:41 +01:00
zen0bit 9f11bb3d02 ci: add quickget tests to github actions. closes #1153 2024-05-03 18:00:41 +01:00
zen0bit 3b7f50d3d5 fix: correct help_message() for -ca -ua; make OS optional 2024-05-03 18:00:41 +01:00
zen0bit 0143416856 ci: Add PR template (RAW initial commit) 2024-05-01 20:48:21 +02:00
9 changed files with 313 additions and 159 deletions

22
.github/pull_request_template vendored Normal file
View File

@ -0,0 +1,22 @@
<!-- Uncomment relevant sections fill relevant and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **YES**|**briefly**|**NO**
<!--
#### Change current OS
- This PR will change current OS: **YES**|**NO**
- Enter changed OS name: **NAME**
-->
<!--
#### Add new OS
- This PR will add new OS: **YES**|**NO**
- Enter new OS name: **NAME**
-->
<!--
#### Change something else
- This PR will change something else: **YES**|**NO**
- Enter short description of changes: **DESCRIPTION**
-->

View File

@ -1,28 +0,0 @@
name: "Publish tags to FlakeHub"
on:
push:
tags:
- "v?[0-9]+.[0-9]+.[0-9]+*"
workflow_dispatch:
inputs:
tag:
description: "The existing tag to publish to FlakeHub"
type: "string"
required: true
jobs:
flakehub-publish:
runs-on: "ubuntu-latest"
permissions:
id-token: "write"
contents: "read"
steps:
- uses: "actions/checkout@v3"
with:
ref: "${{ (inputs.tag != null) && format('refs/tags/{0}', inputs.tag) || '' }}"
- uses: "DeterminateSystems/nix-installer-action@main"
- uses: "DeterminateSystems/magic-nix-cache-action@main"
- uses: "DeterminateSystems/flakehub-push@main"
with:
visibility: "public"
name: "quickemu-project/quickemu"
tag: "${{ inputs.tag }}"

18
.github/workflows/lint-shellcheck.yml vendored Normal file
View File

@ -0,0 +1,18 @@
name: "Lint Shellcheck 🐚"
on:
pull_request:
branches: '**'
workflow_dispatch:
jobs:
shellcheck:
name: Shellcheck
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
with:
format: gcc
severity: error

View File

@ -1,36 +0,0 @@
name: Publish PPA 📦️
on:
workflow_dispatch:
jobs:
publish-ppa:
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: Publish to PPA
env:
DEBEMAIL: ${{ secrets.DEBEMAIL }}
DEBFULLNAME: ${{ secrets.DEBFULLNAME }}
run: |
REL_VER=$(grep "^readonly VERSION" quickemu | cut -d'"' -f2)
STAMP=$(date +%y%j.%H%M)
for CODENAME in $(distro-info --supported); do
rm debian/changelog
dch --package quickemu --newversion="${REL_VER}-1~${CODENAME}${STAMP}" --distribution=${CODENAME} "New upstream release." --create
dpkg-buildpackage -d -S -sa
dput ppa:flexiondotorg/quickemu ../quickemu_${REL_VER}-1~${CODENAME}${STAMP}_source.changes
done

View File

@ -1,12 +1,40 @@
name: Build 🏗️ and Publish 📦
name: Publish Release 🏷
on:
push:
tags: ['*']
tags:
- "v?[0-9]+.[0-9]+.[0-9]+*"
workflow_dispatch:
inputs:
tag:
description: "The existing tag to publish"
type: "string"
required: true
jobs:
create-release:
name: Create Release
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" quickemu | 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
@ -17,8 +45,8 @@ jobs:
gh release create "${{ github.ref }}" --draft --generate-notes
build-release:
needs: [create-release]
name: Build Release
needs: [draft-release]
name: "Build Release 👨‍🔧"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
@ -36,7 +64,7 @@ jobs:
publish-release:
needs: [build-release]
name: Publish Release
name: "Publish Release 📤️"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
@ -48,3 +76,54 @@ jobs:
exit 1
fi
gh release edit "${{ github.ref }}" --draft=false
publish-flakehub:
needs: [version-check]
name: "Publish FlakeHub ❄️"
runs-on: "ubuntu-22.04"
permissions:
id-token: "write"
contents: "read"
steps:
- uses: "actions/checkout@v4"
with:
ref: "${{ (inputs.tag != null) && format('refs/tags/{0}', inputs.tag) || '' }}"
- uses: "DeterminateSystems/nix-installer-action@main"
- uses: "DeterminateSystems/magic-nix-cache-action@main"
- uses: "DeterminateSystems/flakehub-push@main"
with:
visibility: "public"
name: "quickemu-project/quickemu"
tag: "${{ inputs.tag }}"
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" quickemu | cut -d'"' -f2)
STAMP=$(date +%y%j.%H%M)
for CODENAME in $(distro-info --supported); do
rm debian/changelog
dch --package quickemu --newversion="${REL_VER}-1~${CODENAME}${STAMP}" --distribution=${CODENAME} "New upstream release." --create
dpkg-buildpackage -d -S -sa
dput ppa:flexiondotorg/quickemu ../quickemu_${REL_VER}-1~${CODENAME}${STAMP}_source.changes
done

View File

@ -1,29 +0,0 @@
--- # reviewdog
name: 'Run shellcheck with reviewdog'
on:
push:
workflow_dispatch:
jobs:
shellcheck:
permissions:
checks: write
contents: read
pull-requests: write
name: 'Run shellcheck with reviewdog'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: haya14busa/action-cond@v1
id: reporter
with:
cond: ${{ github.event_name == 'pull_request' }}
- uses: reviewdog/action-shellcheck@v1
with:
reporter: ${{ steps.reporter.outputs.value }}
level: error
github_token: ${{ secrets.github_token }}
pattern: |
quickget
quickemu

127
.github/workflows/test-quickget.yml vendored Normal file
View File

@ -0,0 +1,127 @@
name: "Test quickget 🧪"
on:
workflow_dispatch:
push:
branches: '**'
paths: [ quickget ]
pull_request:
branches: '**'
paths: [ quickget ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
list-all-supported:
name: "List all supported OS 📝"
runs-on: ubuntu-22.04
# The type of runner that the job will run on
#runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: "List all supported OS variants"
run: |
mkdir -p results
./quickget --list | tee results/supported.txt
echo -e "\nResults:"
echo "- All supported OS variants: $(wc -l results/supported.txt | cut -d' ' -f 1)"
- uses: actions/upload-artifact@v4
with:
name: supported
path: results/supported.txt
list-all-info:
name: "List all OS info "
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Show info about all OS
run: |
export TERM=xterm-256color
mkdir -p results
for os in $(./quickget | sed '/^$/q' | tail -n +3); do
./quickget -12345 "${os}" | tee -a results/infos.txt
done
echo -e "\nResults:"
echo -e "- OS Info URLs: $(grep -c http results/infos.txt)"
- uses: actions/upload-artifact@v4
with:
name: infos
path: results/infos.txt
list-all-urls:
needs: [list-all-supported]
name: "List all URLs 🔗"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: "quickget --url"
run: |
export TERM=xterm-256color
mkdir -p results
./quickget --url | tee results/urls.txt
- uses: actions/download-artifact@v4
with:
path: results
merge-multiple: true
- name: "Show differences ⚖️"
run: |
echo -e "\nResults:"
echo -e "List All URLs:\t$(grep -c http results/urls.txt)"
echo -e "OS Info URLs:\t$(wc -l results/supported.txt | cut -d' ' -f 1)"
- uses: actions/upload-artifact@v4
with:
name: urls
path: results/urls.txt
check-all-urls:
name: "Check all image URLs 💿️"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: "quickget --check"
run: |
export TERM=xterm-256color
mkdir -p results
./quickget --check | tee results/checks.txt
WINDOWS=$(grep -c "windows-" results/checks.txt)
FAILED=$(grep -c ^FAIL results/checks.txt)
SKIPPED=$(grep -c ^SKIP results/checks.txt)
PASSED=$(grep -c ^PASS results/checks.txt)
CHECKED=$((FAILED + SKIPPED + PASSED))
echo -e "\nResults:"
echo -e "- PASSED:\t${PASSED}"
echo -e "- SKIPPED:\t${SKIPPED}\t(of which ${WINDOWS} are Windows)"
echo -e "- FAILED:\t${FAILED}\n"
grep ^FAIL results/checks.txt | tee results/failed.txt
- uses: actions/upload-artifact@v4
with:
name: checks
path: results/checks.txt
- uses: actions/upload-artifact@v4
with:
name: failed
path: results/failed.txt
upload-artifacts:
needs: [list-all-info, list-all-urls, check-all-urls]
name: "Uploading artifacts"
runs-on: ubuntu-22.04
steps:
- uses: actions/download-artifact@v4
with:
path: results
merge-multiple: true
- name: "List results"
run: |
ls -R results/
- uses: actions/upload-artifact@v4
with:
overwrite: true
name: results
path: results/

View File

@ -1385,11 +1385,21 @@ EOF
}
function usage() {
echo " _ _"
echo " __ _ _ _(_) ___| | _____ _ __ ___ _ _"
echo " / _' | | | | |/ __| |/ / _ \ '_ ' _ \| | | |"
echo "| (_| | |_| | | (__| < __/ | | | | | |_| |"
echo " \__, |\__,_|_|\___|_|\_\___|_| |_| |_|\__,_|"
echo " |_| v${VERSION}, using qemu ${QEMU_VER_LONG}"
echo "--------------------------------------------------------------------------------"
echo " Project - https://github.com/quickemu-project/quickemu"
echo " Discord - https://wimpysworld.io/discord"
echo "--------------------------------------------------------------------------------"
echo
echo "Usage"
echo " ${LAUNCHER} --vm ubuntu.conf [optional params]"
echo " ${LAUNCHER} --vm ubuntu.conf <arguments>"
echo
echo "List of optional parameters:"
echo "Arguments"
echo " --access : Enable remote spice access support. 'local' (default), 'remote', 'clientipaddress'"
echo " --braille : Enable braille support. Requires SDL."
echo " --delete-disk : Delete the disk image and EFI variables"

105
quickget
View File

@ -493,8 +493,8 @@ function os_support() {
alpine \
android \
antix \
archlinux \
archcraft \
archlinux \
arcolinux \
artixlinux \
athenaos \
@ -534,6 +534,8 @@ function os_support() {
linuxlite \
linuxmint \
lmde \
lubuntu \
macos \
mageia \
manjaro \
mxlinux \
@ -542,14 +544,12 @@ function os_support() {
nitrux \
nixos \
nwg-shell \
lubuntu \
macos \
openbsd \
openindiana \
opensuse \
oraclelinux \
peppermint \
parrotsec \
peppermint \
popos \
porteus \
primtux \
@ -573,12 +573,12 @@ function os_support() {
tuxedo-os \
ubuntu \
ubuntu-budgie \
ubuntucinnamon \
ubuntukylin \
ubuntu-mate \
ubuntu-server \
ubuntustudio \
ubuntu-unity \
ubuntucinnamon \
ubuntukylin \
ubuntustudio \
vanillaos \
void \
vxlinux \
@ -1298,9 +1298,14 @@ function zsync_get() {
if [ "${OPERATION}" == "show" ]; then
echo "${URL}"
exit 0
elif [ "${OPERATION}" == "test" ]; then
web_check "${URL}"
exit 0
elif [ "${OPERATION}" == "check" ]; then
if ! web_check "${URL}"; then
check_result "${OS}" "${RELEASE}" "${EDITION}" "${URL}" "FAIL"
exit 0
else
check_result "${OS}" "${RELEASE}" "${EDITION}" "${URL}" "PASS"
exit 0
fi
elif command -v zsync &>/dev/null; then
if [ -n "${3}" ]; then
OUT="${3}"
@ -3336,48 +3341,44 @@ function create_vm() {
function help_message() {
#shellcheck disable=SC2016
printf ' _ _
__ _ _ _ _ ___║ ║ ____ _ ___║ ║_
/ _` ║ ║ ║ ║ ║/ __║ ║/ / _` ║/ _ \ __║
( (_║ ║ ║_║ ║ ║ (__║ < (_║ ║ __/ ║_ MIT
\__, ║\__,_║_║\___║_║\ \__, ║\___║\__║ license
║_║ version: %s ║___/ part of Quickemu project
--------------------------------------------------------------
> Quickly create and run optimised Linux, <
> Windows and macOS desktop virtual machines. <
printf '
_ _ _
__ _ _ _(_) ___| | ____ _ ___| |_
/ _` | | | | |/ __| |/ / _` |/ _ \ __|
| (_| | |_| | | (__| < (_| | __/ |_
\__, |\__,_|_|\___|_|\_\__, |\___|\__|
|_| |___/ v%s, using curl %s
--------------------------------------------------------------------------------
Project - https://github.com/quickemu-project/quickemu
Discord - https://wimpysworld.io/discord
--------------------------------------------------------------
--------------------------------------------------------------------------------
Basic Usage:
quickget <os> <release> [edition]
quickget ubuntu 22.04
Usage:
quickget <os> <release> [edition]
quickget ubuntu 22.04
Advanced Usage:
quickget <arg> [path] <os> [re] [ed]
quickget --download ubuntu 22.04
Advanced usage:
quickget <arg> [path] <os> [re] [ed]
quickget --download ubuntu 22.04
Arguments:
-[12345] <os> : Show info* about OS
--download (-d) <os> <re> [ed] : Download the ISO only; no VM configuration
--create-config (-cc) <os> [path/url]: Create default VM config for image
--open-homepage (-o) <os> : Open homepage for the OS
--version (-v) : Show version
--help (-h) : Show this help message
-------------- For testing & development ---------------------
--url (-u) <os> <re> [ed] : Show download URL for an OS release/edition
--url-all (-ua) <os> : Show all download URLs for an OS
--check (-c) <os> [re] [ed] : Check download an OS release/edition is available
--check-all (-ca) <os> : Check all downloads for an OS are available
--list (-l) : List all supported systems in plain text
--list-csv (-lc) : List all supported systems in csv format
--list-json (-lj) : List all supported systems in json format
--------------------------------------------------------------
*info: 1=Logo 2=Based of 3=Credentials 4=Homepage 5=Short info
Can be used in any combination like -13254 or -52
-[12345] <os> : Show info* about OS
--download (-d) <os> <re> [ed] : Download image; no VM configuration
--create-config (-cc) <os> [path/url]: Create default VM config for image
--open-homepage (-o) <os> : Open homepage for the OS
--version (-v) : Show version
--help (-h) : Show this help message
-------------------------- For testing & development ---------------------------
--url (-u) [os] [re] [ed] : Show image URL(s)
--check (-c) [os] [re] [ed] : Check image URL(s)
--list (-l) : List all supported systems
--list-csv (-lc) : List everything in csv format
--list-json (-lj) : List everything in json format
--------------------------------------------------------------------------------
*info: 1=Logo 2=Based of 3=Credentials 4=Homepage 5=Short info
Can be used in any combination like -13254 or -52
supported Operating Systems:\n' "$(quickemu --version)"
Supported Operating Systems:\n\n' "$(quickemu --version)" "${CURL_VERSION}"
os_support | fold -s -w "$(tput cols)"
}
@ -3427,16 +3428,11 @@ case "${1}" in
'--url'|'-u')
OPERATION="show"
shift
;;
'--url-all'|'-ua')
OPERATION="show"
shift
# if no OS is specified, list all URLs for all supported OSes
if [ -z "${1}" ]; then
for OS in $(os_support); do
(test_all "${OS}")
done
else
elif [ -z "${2}" ]; then
test_all "${1}"
fi
exit 0
@ -3444,16 +3440,11 @@ case "${1}" in
'--check'|'-c')
OPERATION="test"
shift
;;
'--check-all'|'-ca')
OPERATION="test"
shift
# if no OS is specified, check all URLs for all supported OSes
if [ -z "${1}" ]; then
for OS in $(os_support); do
(test_all "${OS}")
done
else
elif [ -z "${2}" ]; then
test_all "${1}"
fi
exit 0