File tree Expand file tree Collapse file tree 4 files changed +15
-6
lines changed
features/_usi/initrd.include/usr/bin Expand file tree Collapse file tree 4 files changed +15
-6
lines changed Original file line number Diff line number Diff line change 8383 if : ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.event.action != 'closed' }}
8484 uses : ./.github/workflows/test.yml
8585 with :
86- image_tag : " ${{ needs.meta.outputs.UPLOAD_VERSION }}-metal-sci-usi-amd64-${{ needs.meta.outputs.COMMIT_SHA }}-amd64 "
86+ image_tag : " ${{ needs.meta.outputs.UPLOAD_VERSION }}-metal-sci-usi-amd64-${{ needs.meta.outputs.UPLOAD_VERSION }}-${{ needs.meta.outputs.COMMIT_SHA }} "
8787
8888 cleanup_images :
8989 name : Cleanup PR images
Original file line number Diff line number Diff line change 3333 id : fetch_tag
3434 if : ${{ inputs.image_tag == '' || github.event_name == 'workflow_run' || github.event_name == 'push' }}
3535 run : |
36- latest_tag=$(oras repo tags ghcr.io/gardenlinux/gardenlinux-ccloud | grep -E '^[0-9]+\.[0-9]+\.[0-9]+-metal-sci-usi-amd64-[0-9a-f]{8}-amd64 $' | sort -r | head -n 1)
36+ latest_tag=$(oras repo tags ghcr.io/gardenlinux/gardenlinux-ccloud | grep -E '^[0-9]+\.[0-9]+\.[0-9]+-metal-sci-usi-amd64-[0-9]+-[0-9]+-[0-9]-[0- 9a-f]{8}$' | sort -r | head -n 1)
3737 echo $latest_tag
3838 echo "latest_tag=$latest_tag" >> $GITHUB_ENV
3939 - name : Build
Original file line number Diff line number Diff line change @@ -75,10 +75,19 @@ jobs:
7575 - name : Add additional semver tag
7676 run : |
7777 echo ${{ secrets.GITHUB_TOKEN }} | oras login -u ${{ github.repository_owner }} --password-stdin ghcr.io
78+ COMMIT_SHA_SHORT=$(git rev-parse HEAD | cut -c1-8)
79+ # Keep CNAME reference
7880 CNAME2=${CNAME//_/-}
81+ # Remove version from CNAME
7982 CNAME2=${CNAME2//-${{ inputs.version }}/}
80- echo "Adding additional tag: ${{ inputs.upload_version || inputs.version }}-${CNAME2}-${{ matrix.arch }}"
81- oras tag ghcr.io/${{ github.repository }}:${{ inputs.version }}-${CNAME}-${{ matrix.arch }} ${{ inputs.upload_version || inputs.version }}-${CNAME2}-${{ matrix.arch }}
83+ # Remove commit sha from CNAME
84+ CNAME2=${CNAME2//-${COMMIT_SHA_SHORT}/}
85+ # 8 charachter commit hash
86+ DASHED_VERSION=${{ inputs.upload_version || inputs.version }}
87+ DASHED_VERSION=${DASHED_VERSION//./-}
88+
89+ echo "Adding additional tag: ${{ inputs.upload_version || inputs.version }}-${CNAME2}-${DASHED_VERSION}-${COMMIT_SHA_SHORT}"
90+ oras tag ghcr.io/${{ github.repository }}:${{ inputs.version }}-${CNAME}-${{ matrix.arch }} ${{ inputs.upload_version || inputs.version }}-${CNAME2}-${DASHED_VERSION}-${COMMIT_SHA_SHORT}
8291 -
uses :
actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # [email protected] 8392 with :
8493 path : oci_manifest_entry_${{ env.CNAME }}.json
Original file line number Diff line number Diff line change @@ -71,10 +71,10 @@ export HOME=/root
7171# source optional config file
7272[ -f /sysroot/opt/persist/gl-oci.conf ] && . /sysroot/opt/persist/gl-oci.conf
7373OCI_REPO=" ${OCI_REPO:- keppel.global.cloud.sap/ ccloud-ghcr-io-mirror/ gardenlinux/ gardenlinux-ccloud} "
74- OCI_ARCH=" ${OCI_ARCH:- amd64} "
7574
75+ DASHED_GARDENLINUX_VERSION=${GARDENLINUX_VERSION// ./ -}
7676# setup OCI_TAG, UKI_SHA and fetch UKI
77- OCI_TAG=${OCI_TAG:- " $GARDENLINUX_VERSION -$VARIANT_ID -$GARDENLINUX_COMMIT_ID - $OCI_ARCH " }
77+ OCI_TAG=${OCI_TAG:- " $GARDENLINUX_VERSION -$VARIANT_ID -${DASHED_GARDENLINUX_VERSION} - $GARDENLINUX_COMMIT_ID " }
7878OCI_TAG=${OCI_TAG// _/ -} # replace underscores with dashes
7979UKI_SHA=$( oras manifest fetch " $OCI_REPO :${OCI_TAG} " | jq -r ' .layers[] | select(.mediaType=="application/io.gardenlinux.uki") | .digest' )
8080oras blob fetch " $OCI_REPO @$UKI_SHA " -o " $esp_dir /EFI/Linux/uki.efi"
You can’t perform that action at this time.
0 commit comments