Skip to content

Commit

Permalink
Shorten image list and break into separate file
Browse files Browse the repository at this point in the history
Easier to run via act for testing.
We now omit old previews and no longer truncate valid tags containing dashes
  • Loading branch information
isc-tleavitt committed Jan 30, 2024
1 parent b554c02 commit 18fac8c
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 17 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Images List
on:
workflow_call:
outputs:
images:
description: "The full list of images to use, as a JSON array of imagename:tag"
value: ${{ jobs.images.outputs.images }}
secondword:
description: "The main image to use (earliest relevant version) to generate the installer XML file"
value: ${{ jobs.images.outputs.main }}

env:
name: |
irishealth-community
iris-community
jobs:
images:
runs-on: ubuntu-latest
outputs:
images: ${{ steps.set-matrix.outputs.images }}
main: ${{ steps.set-matrix.outputs.main }}
steps:
- name: Images list
id: set-matrix
run: |
images=""
for n in $name; do
tags=$(curl -su ":" https://containers.intersystems.com/v2/intersystems/${n}/tags/list | jq -r '.tags[]' | awk '!/(-linux)|([1-4]-preview)/' | awk '!/\.[1-4]\.0\./' | uniq)
for tag in $tags; do images+='"'${n}:${tag}'",'; done
done;
echo images="[${images%?}]" >> $GITHUB_OUTPUT
echo main=${images%%,*} >> $GITHUB_OUTPUT
26 changes: 9 additions & 17 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,21 @@ on:
release:
types:
- released
env:
name: |
irishealth-community
iris-community

jobs:
images:
uses: ./.github/workflows/images.yml

prepare:
runs-on: ubuntu-latest
needs: images
outputs:
images: ${{ steps.set-matrix.outputs.images }}
main: ${{ steps.set-matrix.outputs.main }}
images: ${{ needs.images.outputs.images }}
main: ${{ needs.images.outputs.main }}
version: ${{ steps.version.outputs.number }}
steps:
- uses: actions/checkout@master
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Images list
if: ${{ !env.ACT }}
id: set-matrix
run: |
images=""
for n in $name; do
tags=$(curl -su ":" https://containers.intersystems.com/v2/intersystems/${n}/tags/list | jq -r '.tags[]' | cut -d '-' -f1 | uniq)
for tag in $tags; do images+='"'${n}:${tag}'",'; done
done;
echo images="[${images%?}]" >> $GITHUB_OUTPUT
echo main=${images%%,*} >> $GITHUB_OUTPUT
- name: Setup version
id: version
run: |
Expand All @@ -45,6 +35,7 @@ jobs:
[ $GITHUB_EVENT_NAME == 'push' ] && VERSION+=-beta && VERSION+=.$(($(git tag -l "v$VERSION.*" | sort -nt. -k4 2>/dev/null | tail -1 | cut -d. -f4)+1))
[ $GITHUB_EVENT_NAME == 'pull_request' ] && VERSION+=-dev.${{ github.event.pull_request.number }} && VERSION+=.$(($(git tag -l "v$VERSION.*" | sort -nt. -k4 2>/dev/null | tail -1 | cut -d. -f5)+1))
echo number=${VERSION} >> $GITHUB_OUTPUT
build:
timeout-minutes: 20
needs:
Expand Down Expand Up @@ -203,6 +194,7 @@ jobs:
with:
name: zpm-${{ needs.prepare.outputs.version }}
path: zpm-${{ needs.prepare.outputs.version }}.xml

release:
runs-on: ubuntu-latest
if: github.event.repository.fork == false
Expand Down

0 comments on commit 18fac8c

Please sign in to comment.