From 1fcb5cbc8af53d2f29537129794a011553c3169c Mon Sep 17 00:00:00 2001 From: Robert Sturla Date: Sat, 21 Dec 2024 00:43:23 +0000 Subject: [PATCH] add more tags --- .github/workflows/build-kinoite-40.yml | 24 ++++++++++++++++++++++-- .github/workflows/reusable-build.yml | 12 +++++++++++- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-kinoite-40.yml b/.github/workflows/build-kinoite-40.yml index 83278b99..246b9860 100644 --- a/.github/workflows/build-kinoite-40.yml +++ b/.github/workflows/build-kinoite-40.yml @@ -27,11 +27,31 @@ jobs: - name: Generate Tags id: generate-tags + env: + IS_LATEST_VERSION: false + IS_GTS_VERSION: true + IS_BETA_VERSION: false run: | + TIMESTAMP="$(date +%Y%m%d)" + SHA_SHORT="${GITHUB_SHA::7}" + TAGS=() + TAGS+=("${FEDORA_VERSION}") + + if [[ "${IS_LATEST_VERSION}" == "true" ]]; then + TAGS+=("latest") + elif [[ "${IS_GTS_VERSION}" == "true" ]]; then + TAGS+=("gts") + elif [[ "${IS_BETA_VERSION}" == "true" ]]; then + TAGS+=("beta") + fi - TAGS+=("test") - TAGS+=("rs-test") + for TAG in "${TAGS[@]}"; do + TAGS+=("${TAG}-${TIMESTAMP}") + done + for TAG in "${TAGS[@]}"; do + TAGS+=("${TAG}-${SHA_SHORT}") + done echo "TAGS=$(IFS=,; echo "${TAGS[*]}")" >> $GITHUB_OUTPUT diff --git a/.github/workflows/reusable-build.yml b/.github/workflows/reusable-build.yml index e152907a..3bb9acdc 100644 --- a/.github/workflows/reusable-build.yml +++ b/.github/workflows/reusable-build.yml @@ -23,6 +23,8 @@ on: description: "The build arguments to pass to the build" required: false type: string + output: + manifest-digest: ${{ jobs.manifest.outputs.manifest-digest }} concurrency: group: ${{ github.workflow }}-${{ github.ref || github.run_id }}-${{ inputs.fedora_version }}-${{ inputs.fedora_edition }}-${{ inputs.platforms }} @@ -120,6 +122,8 @@ jobs: manifest: runs-on: ubuntu-latest needs: build + outputs: + manifest-digest: ${{ steps.push-manifest.outputs.DIGEST }} steps: - name: Fetch Build Outputs uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4 @@ -178,11 +182,17 @@ jobs: run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - name: Push manifest + id: push-manifest env: TAGS: ${{ inputs.tags }} MANIFEST: ${{ steps.create-manifest.outputs.MANIFEST }} IMAGE_REGISTRY: ${{ inputs.image-registry }} run: | for tag in $(echo $TAGS | tr ',' '\n'); do - echo "podman manifest push --all=false $MANIFEST $IMAGE_REGISTRY/$tag" + echo "podman manifest push --digestfile=/tmp/digestfile --all=false $MANIFEST $IMAGE_REGISTRY/$tag" done + + # Temporarily populate the digest file with a dummy value + echo "dummy-digest" > /tmp/digestfile + + echo "DIGEST=$(cat /tmp/digestfile)" >> $GITHUB_OUTPUT