Skip to content

Commit

Permalink
Add Snap update automation plus automated versioning (#24)
Browse files Browse the repository at this point in the history
- Added the GitHub workflow .github/workflows/auto-update.yml to use
  the GitHub action of https://github.com/ubuntu/desktop-snaps to add
  automation of updating snapcraft.yaml whenever the upstream
  organization of the source of one of the parts issues a new
  release. The workflow checks the ustream sources every 24 hours (or
  by manually triggering in the GitHub web interface). See
  https://ubuntu.com/blog/improving-snap-maintenance-with-automation

- Updated snapcraft.yaml to make the update automation applying to the
  parts, by downloading the source code from their GIT repos,
  selecting the version via source-tag: and marking the inclusion in
  the automation by source-depth:. Also added directives for the
  version tag format and exclusion of new generations or x.9y
  (possibly pre-release) versions.* Add update automation

- Made use of the recently added widening of version numbering scheme
  support in ubuntu/desktop-snaps and the auto-pseudo-release-tagging
  GtHub workflow in foomatic-db.
  • Loading branch information
rudra-iitm authored Jan 11, 2024
1 parent 66bef3c commit d2a1e51
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 6 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/auto-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Push new tag update to stable branch

on:
schedule:
# Daily for now
- cron: '9 7 * * *'
workflow_dispatch:

jobs:
update-snapcraft-yaml:
runs-on: ubuntu-latest
steps:
- name: Checkout this repo
uses: actions/checkout@v3
- name: Run desktop-snaps action
uses: ubuntu/desktop-snaps@stable
with:
token: ${{ secrets.GITHUB_TOKEN }}
repo: ${{ github.repository }}

72 changes: 66 additions & 6 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,12 @@ parts:
pappl:
source: https://github.com/michaelrsweet/pappl
source-type: git
source-tag: 'v1.4.4'
source-depth: 1
source-tag: v1.4.2
# ext:updatesnap
# version-format:
# lower-than: '2'
# no-9x-revisions: true
plugin: autotools
override-build: |
set -eux
Expand Down Expand Up @@ -101,7 +105,11 @@ parts:
pappl-retrofit:
source: https://github.com/openprinting/pappl-retrofit
source-type: git
source-tag: '1.0b2'
source-depth: 1
# ext:updatesnap
# version-format:
# format: '%V'
plugin: autotools
autotools-configure-parameters:
- --prefix=/usr
Expand Down Expand Up @@ -139,7 +147,14 @@ parts:
after: [cups, pappl, libcupsfilters, libppd]

qpdf:
source: https://github.com/qpdf/qpdf/releases/download/v11.4.0/qpdf-11.4.0.tar.gz
source: https://github.com/qpdf/qpdf/
source-type: git
source-tag: 'v11.8.0'
source-depth: 1
# ext:updatesnap
# version-format:
# lower-than: '12'
# no-9x-revisions: true
plugin: cmake
cmake-parameters:
- -DCMAKE_INSTALL_PREFIX=/
Expand Down Expand Up @@ -181,7 +196,16 @@ parts:
- -usr/lib/pkgconfig

ghostscript:
source: https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs10012/ghostscript-10.01.2.tar.gz
#source: https://git.ghostscript.com/ghostpdl.git
source: https://github.com/ArtifexSoftware/ghostpdl.git
source-type: git
source-tag: 'ghostpdl-10.02.1'
source-depth: 1
# ext:updatesnap
# version-format:
# format: "ghostpdl-%M.%m.%R"
# lower-than: '11'
# no-9x-revisions: true
plugin: autotools
# We only need PostScript output, for converting PDF input
autotools-configure-parameters:
Expand Down Expand Up @@ -219,8 +243,12 @@ parts:
cups:
source: https://github.com/OpenPrinting/cups
source-type: git
source-tag: 'v2.4.7'
source-depth: 1
source-tag: v2.4.7
# ext:updatesnap
# version-format:
# lower-than: '3'
# no-9x-revisions: true
plugin: autotools
# We only need libcups (with headers, ...) and the backends
override-build: |
Expand Down Expand Up @@ -304,7 +332,12 @@ parts:
libcupsfilters:
source: https://github.com/OpenPrinting/libcupsfilters
source-type: git
source-tag: '2.0.0'
source-depth: 1
# ext:updatesnap
# version-format:
# lower-than: '3'
# no-9x-revisions: true
plugin: autotools
# We only need libcupsfilters itself. so we simply do not prime the
# auxiliary files (/usr/share)
Expand Down Expand Up @@ -369,7 +402,12 @@ parts:
libppd:
source: https://github.com/OpenPrinting/libppd
source-type: git
source-tag: '2.0.0'
source-depth: 1
# ext:updatesnap
# version-format:
# lower-than: '3'
# no-9x-revisions: true
plugin: autotools
# We only need libppd itself, so we also do not prime the auxiliary files
# here.
Expand Down Expand Up @@ -411,7 +449,12 @@ parts:
cups-filters:
source: https://github.com/OpenPrinting/cups-filters
source-type: git
source-tag: '2.0.0'
source-depth: 1
# ext:updatesnap
# version-format:
# lower-than: '3'
# no-9x-revisions: true
plugin: autotools
# To find the libraries built in this Snap
build-environment:
Expand Down Expand Up @@ -474,14 +517,26 @@ parts:
pyppd:
source: https://github.com/OpenPrinting/pyppd
source-type: git
source-tag: 'release-1-1-0'
source-depth: 1
# ext:updatesnap
# version-format:
# format: "release-%M-%m-%R"
# lower-than: '2'
# no-9x-revisions: true
plugin: python
override-prime: ""

foomatic-db:
source: https://github.com/OpenPrinting/foomatic-db
source-type: git
source-tag: '20240109'
source-depth: 1
# Excluding foomatic-git from the update automation process
# as it lacks any official releases.
# ext:updatesnap
# version-format:
# format: '%V'
plugin: nil
override-pull: |
set -eux
Expand Down Expand Up @@ -565,8 +620,13 @@ parts:
# Debian source
source: https://salsa.debian.org/printing-team/hplip.v2.git
source-type: git
source-branch: debian/3.22.10+dfsg0-2
source-depth: 1
source-tag: 'debian/3.22.10+dfsg0-4'
source-depth: 1
# Excluding hplip from the update automation process because the UpdateSnap script is
# unable to retrieve the source-tag or source-branch for this repository.
# ext:updatesnap
# version-format:
# format: 'debian/%V'
# Upstream source
#source: https://sourceforge.net/projects/hplip/files/hplip/3.22.10/hplip-3.22.10.tar.gz
plugin: nil
Expand Down

0 comments on commit d2a1e51

Please sign in to comment.