Skip to content

Commit

Permalink
Merge pull request #52 from 417-72KI/matrix-for-mint-version
Browse files Browse the repository at this point in the history
Map Mint version with Swift versions
  • Loading branch information
417-72KI authored Mar 6, 2024
2 parents 41f1d7d + cbe3490 commit 6153a25
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
9 changes: 6 additions & 3 deletions .github/matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
"5.7",
"5.6"
],
"mint_revision": [
"master"
]
"mint_revision": {
"5.9": "master",
"5.8": "0.17.5",
"5.7": "0.17.5",
"5.6": "0.17.5"
}
}
12 changes: 9 additions & 3 deletions .github/workflows/docker_hub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,16 @@ jobs:
needs: generate-matrix
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
matrix:
swift_version: ${{ fromJson(needs.generate-matrix.outputs.matrix).swift_version }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set Mint version
id: set-mint-version
run: |
mint_revision=$(echo '${{ needs.generate-matrix.outputs.matrix }}' | jq -c '.mint_revision' | jq -r '.["${{ matrix.swift_version }}"]')
echo "mint-revision=$mint_revision" >> $GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
Expand Down Expand Up @@ -89,7 +95,7 @@ jobs:
tags: ${{ steps.create-tags.outputs.tags }}
build-args: |
SWIFT_VERSION=${{ matrix.swift_version }}
MINT_REVISION=${{ matrix.mint_revision }}
MINT_REVISION=${{ steps.set-mint-version.outputs.mint-revision }}
- name: Verify Mint revision to check if it needs to update image
if: ${{ github.event_name != 'workflow_dispatch' }}
id: needs-update
Expand All @@ -116,4 +122,4 @@ jobs:
tags: ${{ steps.create-tags.outputs.tags }}
build-args: |
SWIFT_VERSION=${{ matrix.swift_version }}
MINT_REVISION=${{ matrix.mint_revision }}
MINT_REVISION=${{ steps.set-mint-version.outputs.mint-revision }}
12 changes: 9 additions & 3 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,16 @@ jobs:
needs: generate-matrix
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
matrix:
swift_version: ${{ fromJson(needs.generate-matrix.outputs.matrix).swift_version }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set Mint version
id: set-mint-version
run: |
mint_revision=$(echo '${{ needs.generate-matrix.outputs.matrix }}' | jq -c '.mint_revision' | jq -r '.["${{ matrix.swift_version }}"]')
echo "mint-revision=$mint_revision" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker image
Expand All @@ -42,10 +48,10 @@ jobs:
with:
push: false
load: true
tags: ${{ env.DOCKER_USER }}/${{ env.DOCKER_REPO }}:${{ matrix.swift_version }}-${{ matrix.mint_revision }}
tags: ${{ env.DOCKER_USER }}/${{ env.DOCKER_REPO }}:${{ matrix.swift_version }}-${{ steps.set-mint-version.outputs.mint-revision }}
build-args: |
SWIFT_VERSION=${{ matrix.swift_version }}
MINT_REVISION=${{ matrix.mint_revision }}
MINT_REVISION=${{ steps.set-mint-version.outputs.mint-revision }}
- name: Export versions
id: export-versions
run: |
Expand Down

0 comments on commit 6153a25

Please sign in to comment.