Skip to content

Commit

Permalink
cicd: automate list of "golang" image versions
Browse files Browse the repository at this point in the history
Signed-off-by: Hank Donnay <[email protected]>
  • Loading branch information
hdonnay committed Sep 5, 2024
1 parent 70a5e30 commit 64d2456
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .github/workflows/golang-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,27 @@ env:
QUAY_USER: projectquay+claircore_github

jobs:
versions:
if: ${{ github.repository == 'quay/claircore' }}
name: Check available go versions
runs-on: 'ubuntu-latest'
outputs:
versions: ${{ steps.versions.outputs.versions }}
steps:
- id: versions
run: |
curl -sL 'https://golang.org/dl/?mode=json' |
jq -rc 'map(.version|sub("go(?<maj>1\\.[0-9]+)\\.[0-9]+$";"\(.maj)"))|@text "versions=\(.)"' >> $GITHUB_OUTPUT
golang-image:
if: ${{ github.repository == 'quay/claircore' }}
needs: versions
name: Build and publish golang image
runs-on: 'ubuntu-latest'
strategy:
fail-fast: false
matrix:
go: ['1.18', '1.19', '1.20', '1.21', '1.22']
go: ${{ fromJSON(needs.versions.outputs.versions) }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down

0 comments on commit 64d2456

Please sign in to comment.