Skip to content

Commit

Permalink
Commit the Ubuntu support matrix automatically
Browse files Browse the repository at this point in the history
Fixes #10
  • Loading branch information
strugee committed Oct 1, 2024
1 parent 5f5a6ab commit 8de140c
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/build-and-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,22 @@ on:
workflow_dispatch:

jobs:
build_push_images:
get-ubuntu-versions:
runs-on: ubuntu-latest
outputs:
versions: ${{ steps.versions.outputs.versions }}
steps:
- name: Query Launchpad API for active and supported Ubuntu versions
id: versions
# This command actually grabs Ubuntu ESM-supported releases too, but the Launchpad API doesn't give a way to differentiate these out so who cares
run: curl https://api.launchpad.net/devel/ubuntu/series | jq '.entries[] | select(.supported == true and .active == true) | .version' | tr '\n' ' ' | sed -e 's/^/versions=[/' -e 's/ $/]/' -e 's/ /, /g' >> "$GITHUB_OUTPUT"

build-push-images:
runs-on: ubuntu-latest
needs: get-ubuntu-versions
strategy:
matrix:
# curl https://api.launchpad.net/devel/ubuntu/series | jq '.entries[] | select(.supported == true and .active == true) | .version' | tr '\n' ' ' | sed -e 's/^/[/' -e 's/ $/]/' -e 's/ /, /g'
# The above command actually grabs Ubuntu ESM-supported releases too, but the Launchpad API doesn't give a way to differentiate these out so who cares
version: ["24.04", "22.04", "20.04", "18.04", "16.04", "14.04"]
version: ${{ fromJSON(needs.get-ubuntu-versions.outputs.versions }}
env:
REGISTRY_USER: ${{ github.actor }}
REGISTRY_PASSWORD: ${{ github.token }}
Expand Down

0 comments on commit 8de140c

Please sign in to comment.