Skip to content

Commit

Permalink
fix(Push): Fixes manifest build, test, push
Browse files Browse the repository at this point in the history
- Fixes source images for generated meta data used by manifest creation.
  • Loading branch information
timnolte committed Dec 15, 2023
1 parent 6f7b1cb commit 98a8955
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 13 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,15 @@ jobs:

- name: Prepare Container Image Archive
run: |
rm -f /tmp/php-${{ matrix.PHP_VERSION }}-node-${{ matrix.NODE_VERSION }}-oci.tar
mv /tmp/output.tar /tmp/php-${{ matrix.PHP_VERSION }}-node-${{ matrix.NODE_VERSION }}-oci.tar
rm -f /tmp/php-${{ matrix.PHP_VERSION }}-node-${{ matrix.NODE_VERSION }}-${{ matrix.platform }}-oci.tar
mv /tmp/output.tar /tmp/php-${{ matrix.PHP_VERSION }}-node-${{ matrix.NODE_VERSION }}-${{ matrix.platform }}-oci.tar
# https://github.com/marketplace/actions/upload-a-build-artifact
- name: Upload Digests
uses: actions/upload-artifact@v3
with:
name: ${{ env.PACKAGE }}-php-${{ matrix.PHP_VERSION }}-node-${{ matrix.NODE_VERSION }}-${{ matrix.platform }}
path: /tmp/php-${{ matrix.PHP_VERSION }}-node-${{ matrix.NODE_VERSION }}-oci.tar
path: /tmp/php-${{ matrix.PHP_VERSION }}-node-${{ matrix.NODE_VERSION }}-${{ matrix.platform }}-${{ matrix.platform }}-oci.tar
if-no-files-found: error
retention-days: 1

Expand All @@ -129,22 +129,22 @@ jobs:
runs-on: ubuntu-latest

concurrency:
group: ${{ matrix.PHP_VERSION }}-${{ matrix.NODE_VERSION }}-${{ matrix.platform }}
group: ${{ matrix.PHP_VERSION }}-${{ matrix.NODE_VERSION }}

steps:
# https://github.com/marketplace/actions/download-a-build-artifact
- name: Download Digests - amd64
uses: actions/download-artifact@v3
with:
name: ${{ env.PACKAGE }}-php-${{ matrix.PHP_VERSION }}-node-${{ matrix.NODE_VERSION }}-amd64
path: /tmp/${{ env.PACKAGE }}/amd64/${{ env.PACKAGE }}-php-${{ matrix.PHP_VERSION }}-node-${{ matrix.NODE_VERSION }}-oci.tar
path: /tmp/${{ env.PACKAGE }}/php-${{ matrix.PHP_VERSION }}-node-${{ matrix.NODE_VERSION }}-amd64-oci.tar

# https://github.com/marketplace/actions/download-a-build-artifact
- name: Download Digests - arm64
uses: actions/download-artifact@v3
with:
name: ${{ env.PACKAGE }}-php-${{ matrix.PHP_VERSION }}-node-${{ matrix.NODE_VERSION }}-arm64
path: /tmp/${{ env.PACKAGE }}/arm64/${{ env.PACKAGE }}-php-${{ matrix.PHP_VERSION }}-node-${{ matrix.NODE_VERSION }}-oci.tar
path: /tmp/${{ env.PACKAGE }}/php-${{ matrix.PHP_VERSION }}-node-${{ matrix.NODE_VERSION }}-arm64-oci.tar

# https://github.com/marketplace/actions/docker-setup-buildx
- name: Set up Docker Buildx
Expand All @@ -164,7 +164,6 @@ jobs:
uses: docker/metadata-action@v5
id: metadata
with:
images: ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.PACKAGE }}
tags: type=raw,value=php-${{ matrix.PHP_VERSION }}-node-${{ matrix.NODE_VERSION }}

- name: Create Manifest List and Push
Expand All @@ -173,6 +172,11 @@ jobs:
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.PACKAGE }}@sha256:%s ' *)
- name: Inspect Manifest List
working-directory: /tmp/${{ env.PACKAGE }}
run: |
docker buildx imagetools inspect ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.PACKAGE }}:php-${{ matrix.PHP_VERSION }}-node-${{ matrix.NODE_VERSION }}
release:
name: Publish Release
runs-on: ubuntu-latest
Expand Down
34 changes: 28 additions & 6 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ jobs:

- name: Test Copying Container Image Archive
run: |
rm -f /tmp/php-${{ matrix.PHP_VERSION }}-node-${{ matrix.NODE_VERSION }}-oci.tar
mv /tmp/output.tar /tmp/php-${{ matrix.PHP_VERSION }}-node-${{ matrix.NODE_VERSION }}-oci.tar
rm -f /tmp/php-${{ matrix.PHP_VERSION }}-node-${{ matrix.NODE_VERSION }}-${{ matrix.platform }}-oci.tar
mv /tmp/output.tar /tmp/php-${{ matrix.PHP_VERSION }}-node-${{ matrix.NODE_VERSION }}-${{ matrix.platform }}-oci.tar
# https://github.com/marketplace/actions/upload-a-build-artifact
- name: Upload Digests
uses: actions/upload-artifact@v3
with:
name: ${{ env.PACKAGE }}-php-${{ matrix.PHP_VERSION }}-node-${{ matrix.NODE_VERSION }}-${{ matrix.platform }}
path: /tmp/php-${{ matrix.PHP_VERSION }}-node-${{ matrix.NODE_VERSION }}-oci.tar
path: /tmp/php-${{ matrix.PHP_VERSION }}-node-${{ matrix.NODE_VERSION }}-${{ matrix.platform }}-${{ matrix.platform }}-oci.tar
if-no-files-found: error
retention-days: 1

Expand All @@ -118,24 +118,46 @@ jobs:
runs-on: ubuntu-latest

concurrency:
group: ${{ matrix.PHP_VERSION }}-${{ matrix.NODE_VERSION }}-${{ matrix.platform }}
group: ${{ matrix.PHP_VERSION }}-${{ matrix.NODE_VERSION }}

steps:
# https://github.com/marketplace/actions/download-a-build-artifact
- name: Download Digests - amd64
uses: actions/download-artifact@v3
with:
name: ${{ env.PACKAGE }}-php-${{ matrix.PHP_VERSION }}-node-${{ matrix.NODE_VERSION }}-amd64
path: /tmp/${{ env.PACKAGE }}/amd64/${{ env.PACKAGE }}-php-${{ matrix.PHP_VERSION }}-node-${{ matrix.NODE_VERSION }}-oci.tar
path: /tmp/${{ env.PACKAGE }}/php-${{ matrix.PHP_VERSION }}-node-${{ matrix.NODE_VERSION }}-amd64-oci.tar

# https://github.com/marketplace/actions/download-a-build-artifact
- name: Download Digests - arm64
uses: actions/download-artifact@v3
with:
name: ${{ env.PACKAGE }}-php-${{ matrix.PHP_VERSION }}-node-${{ matrix.NODE_VERSION }}-arm64
path: /tmp/${{ env.PACKAGE }}/arm64/${{ env.PACKAGE }}-php-${{ matrix.PHP_VERSION }}-node-${{ matrix.NODE_VERSION }}-oci.tar
path: /tmp/${{ env.PACKAGE }}/php-${{ matrix.PHP_VERSION }}-node-${{ matrix.NODE_VERSION }}-arm64-oci.tar

# https://github.com/marketplace/actions/docker-setup-buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: List Artifact Downloads
run: ls -R
working-directory: /tmp/${{ env.PACKAGE }}

# https://github.com/marketplace/actions/docker-metadata-action
- name: Docker Metadata
uses: docker/metadata-action@v5
id: metadata
with:
tags: type=raw,value=php-${{ matrix.PHP_VERSION }}-node-${{ matrix.NODE_VERSION }}

- name: Create Manifest List & Image Locally
working-directory: /tmp/${{ env.PACKAGE }}
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ env.PACKAGE }}@sha256:%s ' *)
- name: Inspect Manifest List
working-directory: /tmp/${{ env.PACKAGE }}
run: |
docker buildx imagetools inspect ${{ env.PACKAGE }}:php-${{ matrix.PHP_VERSION }}-node-${{ matrix.NODE_VERSION }}

0 comments on commit 98a8955

Please sign in to comment.