mirror of
https://github.com/floci-io/floci.git
synced 2026-12-06 03:28:18 -05:00
Bumps the actions-minor-patch group with 8 updates in the / directory: | Package | From | To | | --- | --- | --- | | [graalvm/setup-graalvm](https://github.com/graalvm/setup-graalvm) | `1.6.7` | `1.6.10` | | [docker/login-action](https://github.com/docker/login-action) | `4.7.0` | `4.8.0` | | [actions/setup-java](https://github.com/actions/setup-java) | `6.1.0` | `6.3.0` | | [azure/setup-helm](https://github.com/azure/setup-helm) | `5.0.1` | `5.1.0` | | [anchore/sbom-action](https://github.com/anchore/sbom-action) | `0.24.3` | `0.24.4` | | [anchore/scan-action](https://github.com/anchore/scan-action) | `7.4.2` | `7.4.3` | | [aws-actions/amazon-ecr-login](https://github.com/aws-actions/amazon-ecr-login) | `2.1.7` | `2.2.0` | | [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) | `4.1.2` | `4.1.4` | Updates `graalvm/setup-graalvm` from 1.6.7 to 1.6.10 - [Release notes](https://github.com/graalvm/setup-graalvm/releases) - [Commits](https://github.com/graalvm/setup-graalvm/compare/27b360dbb857524eaf0b4c4cef364d38e5b4f173...60e76998d25690099182b796e99b8804da582d90) Updates `docker/login-action` from 4.7.0 to 4.8.0 - [Release notes](https://github.com/docker/login-action/releases) - [Commits](https://github.com/docker/login-action/compare/81c6f93d4bc991e510b342a00b419b3bb4efc5c6...8aa5831fb8d48d8f76594c7ddde61ae58019f550) Updates `actions/setup-java` from 6.1.0 to 6.3.0 - [Release notes](https://github.com/actions/setup-java/releases) - [Commits](https://github.com/actions/setup-java/compare/b843ebf9b913146b38da2eaa7aeddf76074ae1ad...d1374f8ac74474200d16ef8ecee22c7ae7a51880) Updates `azure/setup-helm` from 5.0.1 to 5.1.0 - [Release notes](https://github.com/azure/setup-helm/releases) - [Changelog](https://github.com/Azure/setup-helm/blob/main/CHANGELOG.md) - [Commits](https://github.com/azure/setup-helm/compare/9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310...2f5e7bc67f1f9972ab16657bb795f36d8f04de0e) Updates `anchore/sbom-action` from 0.24.3 to 0.24.4 - [Release notes](https://github.com/anchore/sbom-action/releases) - [Changelog](https://github.com/anchore/sbom-action/blob/main/RELEASE.md) - [Commits](https://github.com/anchore/sbom-action/compare/66cbf4bc1f1c0d2edc94016e65bc221b6bb0ad6c...dfcb83b97731532d72be422cbc51ee64adb6fd56) Updates `anchore/scan-action` from 7.4.2 to 7.4.3 - [Release notes](https://github.com/anchore/scan-action/releases) - [Changelog](https://github.com/anchore/scan-action/blob/main/RELEASE.md) - [Commits](https://github.com/anchore/scan-action/compare/27805bf3b4e84b4a5c980df22ed233c00390a439...11983a512817154c80a9db660c1a184be7513ed6) Updates `aws-actions/amazon-ecr-login` from 2.1.7 to 2.2.0 - [Release notes](https://github.com/aws-actions/amazon-ecr-login/releases) - [Changelog](https://github.com/aws-actions/amazon-ecr-login/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws-actions/amazon-ecr-login/compare/03f1aad4c6c7ffd436567f42f9384779290529bd...7290e214a610b32bc0eef81748948b6d466a8783) Updates `sigstore/cosign-installer` from 4.1.2 to 4.1.4 - [Release notes](https://github.com/sigstore/cosign-installer/releases) - [Commits](https://github.com/sigstore/cosign-installer/compare/6f9f17788090df1f26f669e9d70d6ae9567deba6...881c63bd87e38389154debd8331404ce7ca8a3ab) --- updated-dependencies: - dependency-name: graalvm/setup-graalvm dependency-version: 1.6.10 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions-minor-patch - dependency-name: docker/login-action dependency-version: 4.8.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions-minor-patch - dependency-name: actions/setup-java dependency-version: 6.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions-minor-patch - dependency-name: azure/setup-helm dependency-version: 5.1.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions-minor-patch - dependency-name: anchore/sbom-action dependency-version: 0.24.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions-minor-patch - dependency-name: anchore/scan-action dependency-version: 7.4.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions-minor-patch - dependency-name: aws-actions/amazon-ecr-login dependency-version: 2.2.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions-minor-patch - dependency-name: sigstore/cosign-installer dependency-version: 4.1.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions-minor-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
512 lines
21 KiB
YAML
512 lines
21 KiB
YAML
name: Build Floci Images
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
source-ref:
|
|
description: Floci branch, tag, or commit to publish
|
|
required: true
|
|
type: string
|
|
image:
|
|
description: OCI image repository including registry host (for example, ghcr.io/org/floci), without a tag or digest
|
|
required: true
|
|
type: string
|
|
publish-native:
|
|
description: Also publish native and native compatibility images
|
|
required: false
|
|
type: boolean
|
|
default: false
|
|
secrets:
|
|
REGISTRY_USERNAME:
|
|
description: Username for a registry other than GHCR
|
|
required: false
|
|
REGISTRY_TOKEN:
|
|
description: Token for a registry other than GHCR
|
|
required: false
|
|
outputs:
|
|
source-sha:
|
|
description: Full source revision used for all images
|
|
value: ${{ jobs.prepare.outputs.source-sha }}
|
|
image-tag:
|
|
description: Timestamped source revision tag used for all images
|
|
value: ${{ jobs.prepare.outputs.image-tag }}
|
|
image-ref:
|
|
description: Commit-tagged default JVM image reference
|
|
value: ${{ jobs.publish.outputs.jvm-ref }}
|
|
image-digest-ref:
|
|
description: Immutable default JVM image reference
|
|
value: ${{ jobs.publish.outputs.jvm-digest-ref }}
|
|
jvm-ref:
|
|
description: Commit-tagged JVM image reference
|
|
value: ${{ jobs.publish.outputs.jvm-ref }}
|
|
jvm-digest-ref:
|
|
description: Immutable JVM image reference
|
|
value: ${{ jobs.publish.outputs.jvm-digest-ref }}
|
|
native-ref:
|
|
description: Commit-tagged native image reference when publish-native is true
|
|
value: ${{ jobs.publish.outputs.native-ref }}
|
|
native-digest-ref:
|
|
description: Immutable native image reference when publish-native is true
|
|
value: ${{ jobs.publish.outputs.native-digest-ref }}
|
|
compat-ref:
|
|
description: Commit-tagged native compatibility image reference when publish-native is true
|
|
value: ${{ jobs.publish.outputs.compat-ref }}
|
|
compat-digest-ref:
|
|
description: Immutable native compatibility image reference when publish-native is true
|
|
value: ${{ jobs.publish.outputs.compat-digest-ref }}
|
|
|
|
permissions: {}
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.repository }}-${{ inputs.source-ref }}-${{ inputs.image }}-${{ inputs.publish-native }}
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
prepare:
|
|
name: Resolve source and image
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 5
|
|
permissions:
|
|
contents: read
|
|
outputs:
|
|
image: ${{ steps.image.outputs.image }}
|
|
registry: ${{ steps.image.outputs.registry }}
|
|
source-sha: ${{ steps.source.outputs.sha }}
|
|
image-tag: ${{ steps.source.outputs.image-tag }}
|
|
product-version: ${{ steps.source.outputs.product-version }}
|
|
|
|
steps:
|
|
- name: Validate image repository
|
|
id: image
|
|
shell: bash
|
|
env:
|
|
IMAGE: ${{ inputs.image }}
|
|
REPOSITORY_OWNER: ${{ github.repository_owner }}
|
|
run: |
|
|
owner="${REPOSITORY_OWNER,,}"
|
|
image="$IMAGE"
|
|
|
|
if [[ "$image" != */* ]]; then
|
|
echo "image must include a registry host and repository path." >&2
|
|
exit 1
|
|
fi
|
|
|
|
registry="${image%%/*}"
|
|
repository="${image#*/}"
|
|
registry_pattern='^([a-z0-9]([a-z0-9.-]*[a-z0-9])?)(:[0-9]{1,5})?$'
|
|
component='[a-z0-9]+([._-][a-z0-9]+)*'
|
|
repository_pattern="^${component}(/${component})*$"
|
|
|
|
if [[ "$registry" != "${registry,,}" || ! "$registry" =~ $registry_pattern ]]; then
|
|
echo "image registry must be a lowercase host with an optional port." >&2
|
|
exit 1
|
|
fi
|
|
if [[ "$registry" == *..* || "$registry" == *.-* || "$registry" == *-.* ]]; then
|
|
echo "image registry contains an invalid host separator." >&2
|
|
exit 1
|
|
fi
|
|
if [[ "$registry" == *:* ]]; then
|
|
port="${registry##*:}"
|
|
if (( 10#$port < 1 || 10#$port > 65535 )); then
|
|
echo "image registry port must be between 1 and 65535." >&2
|
|
exit 1
|
|
fi
|
|
fi
|
|
if [[ "$repository" != "${repository,,}" || ! "$repository" =~ $repository_pattern ]]; then
|
|
echo "image repository must be a lowercase path without a tag or digest." >&2
|
|
exit 1
|
|
fi
|
|
if [[ "$registry" == "ghcr.io" && "$repository" != "$owner/"* ]]; then
|
|
echo "GITHUB_TOKEN publication requires a GHCR repository under $owner/." >&2
|
|
exit 1
|
|
fi
|
|
|
|
echo "registry=$registry" >> "$GITHUB_OUTPUT"
|
|
echo "image=$image" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Validate external registry credentials
|
|
if: steps.image.outputs.registry != 'ghcr.io'
|
|
shell: bash
|
|
env:
|
|
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
|
|
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
|
run: |
|
|
if [[ -z "$REGISTRY_USERNAME" || -z "$REGISTRY_TOKEN" ]]; then
|
|
echo "External registries require REGISTRY_USERNAME and REGISTRY_TOKEN." >&2
|
|
exit 1
|
|
fi
|
|
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
ref: ${{ inputs.source-ref }}
|
|
|
|
- &restore-maven-wrapper
|
|
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
with:
|
|
path: ~/.m2/wrapper
|
|
key: maven-wrapper-${{ runner.os }}-${{ hashFiles('.mvn/wrapper/maven-wrapper.properties') }}
|
|
|
|
# Run inline because source-ref can select older revisions of the project.
|
|
- &bootstrap-maven
|
|
name: Bootstrap Maven distribution
|
|
shell: bash
|
|
run: |
|
|
for attempt in 1 2 3; do
|
|
if timeout --kill-after=5s 60s ./mvnw --version; then
|
|
exit 0
|
|
else
|
|
status=$?
|
|
fi
|
|
if (( attempt == 3 )); then
|
|
exit "$status"
|
|
fi
|
|
echo "::warning::Maven wrapper setup failed (exit $status), retrying."
|
|
sleep 5
|
|
done
|
|
|
|
- name: Resolve source revision
|
|
id: source
|
|
shell: bash
|
|
run: |
|
|
source_sha="$(git rev-parse HEAD)"
|
|
source_short="${source_sha:0:8}"
|
|
timestamp="$(date -u +'%Y%m%d.%H%M%S')"
|
|
product_version="$(./mvnw -q -DforceStdout help:evaluate -Dexpression=project.version)"
|
|
|
|
if [[ -z "$product_version" ]]; then
|
|
echo "Could not resolve the Floci project version." >&2
|
|
exit 1
|
|
fi
|
|
|
|
echo "sha=$source_sha" >> "$GITHUB_OUTPUT"
|
|
echo "image-tag=$timestamp.$source_short" >> "$GITHUB_OUTPUT"
|
|
echo "product-version=$product_version" >> "$GITHUB_OUTPUT"
|
|
|
|
build-native-amd64:
|
|
name: Build native artifact (amd64)
|
|
if: inputs.publish-native
|
|
needs: prepare
|
|
# Pinned, like the arm64 jobs. Built on ubuntu-26.04 the binary asks glibc for x86-64-v3
|
|
# whatever -march says, and no longer starts on x86-64-v2 CPUs.
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 45
|
|
permissions:
|
|
contents: read
|
|
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
ref: ${{ needs.prepare.outputs.source-sha }}
|
|
|
|
- uses: graalvm/setup-graalvm@60e76998d25690099182b796e99b8804da582d90 # v1
|
|
with:
|
|
java-version: '25'
|
|
distribution: mandrel
|
|
cache: maven
|
|
github-token: ${{ github.token }}
|
|
|
|
- *restore-maven-wrapper
|
|
- *bootstrap-maven
|
|
|
|
- name: Build native executable
|
|
# Quarkus 3.39 switches on -H:+AOTSingleCallsiteInline for Mandrel 25.0.4+. The generated
|
|
# REST invokers for AwsQueryController.dispatch and AwsJson11Controller.handle are each the
|
|
# single call site of a very large method; inlined, the method outgrows the aarch64
|
|
# conditional-branch range and the build dies with BranchTargetOutOfBoundsException.
|
|
# The flag only exists on Mandrel, so it is passed here rather than in application.yml.
|
|
run: ./mvnw clean package -Dnative -DskipTests -B -Dquarkus.native.additional-build-args-append="-march=x86-64-v2,-H:-AOTSingleCallsiteInline"
|
|
|
|
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
with:
|
|
name: floci-native-amd64-${{ needs.prepare.outputs.image-tag }}
|
|
path: |
|
|
target/*-runner
|
|
target/*.properties
|
|
target/*.so
|
|
if-no-files-found: error
|
|
retention-days: 1
|
|
|
|
build-native-arm64:
|
|
name: Build native artifact (arm64)
|
|
if: inputs.publish-native
|
|
needs: prepare
|
|
runs-on: ubuntu-24.04-arm
|
|
timeout-minutes: 45
|
|
permissions:
|
|
contents: read
|
|
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
ref: ${{ needs.prepare.outputs.source-sha }}
|
|
|
|
- uses: graalvm/setup-graalvm@60e76998d25690099182b796e99b8804da582d90 # v1
|
|
with:
|
|
java-version: '25'
|
|
distribution: mandrel
|
|
cache: maven
|
|
github-token: ${{ github.token }}
|
|
|
|
- *restore-maven-wrapper
|
|
- *bootstrap-maven
|
|
|
|
- name: Build native executable
|
|
# Quarkus 3.39 switches on -H:+AOTSingleCallsiteInline for Mandrel 25.0.4+. The generated
|
|
# REST invokers for AwsQueryController.dispatch and AwsJson11Controller.handle are each the
|
|
# single call site of a very large method; inlined, the method outgrows the aarch64
|
|
# conditional-branch range and the build dies with BranchTargetOutOfBoundsException.
|
|
# The flag only exists on Mandrel, so it is passed here rather than in application.yml.
|
|
run: ./mvnw clean package -Dnative -DskipTests -B -Dquarkus.native.additional-build-args-append="-H:-AOTSingleCallsiteInline"
|
|
|
|
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
with:
|
|
name: floci-native-arm64-${{ needs.prepare.outputs.image-tag }}
|
|
path: |
|
|
target/*-runner
|
|
target/*.properties
|
|
target/*.so
|
|
if-no-files-found: error
|
|
retention-days: 1
|
|
|
|
publish:
|
|
name: Publish images
|
|
needs: [prepare, build-native-amd64, build-native-arm64]
|
|
if: >-
|
|
${{
|
|
always() &&
|
|
needs.prepare.result == 'success' &&
|
|
(!inputs.publish-native ||
|
|
(needs.build-native-amd64.result == 'success' &&
|
|
needs.build-native-arm64.result == 'success'))
|
|
}}
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 45
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
outputs:
|
|
compat-ref: ${{ steps.provenance.outputs.compat-ref }}
|
|
compat-digest-ref: ${{ steps.provenance.outputs.compat-digest-ref }}
|
|
jvm-ref: ${{ steps.provenance.outputs.jvm-ref }}
|
|
jvm-digest-ref: ${{ steps.provenance.outputs.jvm-digest-ref }}
|
|
native-ref: ${{ steps.provenance.outputs.native-ref }}
|
|
native-digest-ref: ${{ steps.provenance.outputs.native-digest-ref }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
ref: ${{ needs.prepare.outputs.source-sha }}
|
|
|
|
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
if: inputs.publish-native
|
|
with:
|
|
name: floci-native-amd64-${{ needs.prepare.outputs.image-tag }}
|
|
path: native/amd64/
|
|
|
|
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
if: inputs.publish-native
|
|
with:
|
|
name: floci-native-arm64-${{ needs.prepare.outputs.image-tag }}
|
|
path: native/arm64/
|
|
|
|
- name: Make native binaries executable
|
|
if: inputs.publish-native
|
|
run: chmod +x native/amd64/*-runner native/arm64/*-runner
|
|
|
|
- name: Set build metadata
|
|
id: metadata
|
|
shell: bash
|
|
run: |
|
|
echo "created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> "$GITHUB_OUTPUT"
|
|
echo "source-date-epoch=$(git log -1 --pretty=%ct)" >> "$GITHUB_OUTPUT"
|
|
|
|
- uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
|
|
|
|
- name: Log in to GitHub Container Registry
|
|
if: needs.prepare.outputs.registry == 'ghcr.io'
|
|
uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4.8.0
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ github.token }}
|
|
|
|
- name: Log in to configured registry
|
|
if: needs.prepare.outputs.registry != 'ghcr.io'
|
|
uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4.8.0
|
|
with:
|
|
registry: ${{ needs.prepare.outputs.registry }}
|
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
|
|
- name: Build and publish JVM image
|
|
id: jvm
|
|
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
|
|
env:
|
|
SOURCE_DATE_EPOCH: ${{ steps.metadata.outputs.source-date-epoch }}
|
|
with:
|
|
context: .
|
|
file: docker/Dockerfile
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
tags: ${{ needs.prepare.outputs.image }}:${{ needs.prepare.outputs.image-tag }}
|
|
build-args: |
|
|
VERSION=${{ needs.prepare.outputs.product-version }}
|
|
labels: |
|
|
org.opencontainers.image.version=${{ needs.prepare.outputs.product-version }}
|
|
org.opencontainers.image.revision=${{ needs.prepare.outputs.source-sha }}
|
|
org.opencontainers.image.vcs-ref=${{ needs.prepare.outputs.source-sha }}
|
|
org.opencontainers.image.created=${{ steps.metadata.outputs.created }}
|
|
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
|
|
version=${{ needs.prepare.outputs.product-version }}
|
|
build-date=${{ steps.metadata.outputs.created }}
|
|
vcs-ref=${{ needs.prepare.outputs.source-sha }}
|
|
cache-from: type=gha,scope=floci-jvm
|
|
cache-to: type=gha,scope=floci-jvm,mode=max
|
|
|
|
- name: Build and publish native image
|
|
id: native
|
|
if: inputs.publish-native
|
|
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
|
|
env:
|
|
SOURCE_DATE_EPOCH: ${{ steps.metadata.outputs.source-date-epoch }}
|
|
with:
|
|
context: .
|
|
file: docker/Dockerfile.native-package
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
tags: ${{ needs.prepare.outputs.image }}:${{ needs.prepare.outputs.image-tag }}-native
|
|
build-args: |
|
|
VERSION=${{ needs.prepare.outputs.product-version }}
|
|
labels: |
|
|
org.opencontainers.image.version=${{ needs.prepare.outputs.product-version }}
|
|
org.opencontainers.image.revision=${{ needs.prepare.outputs.source-sha }}
|
|
org.opencontainers.image.vcs-ref=${{ needs.prepare.outputs.source-sha }}
|
|
org.opencontainers.image.created=${{ steps.metadata.outputs.created }}
|
|
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
|
|
version=${{ needs.prepare.outputs.product-version }}
|
|
build-date=${{ steps.metadata.outputs.created }}
|
|
vcs-ref=${{ needs.prepare.outputs.source-sha }}
|
|
cache-from: type=gha,scope=floci-native
|
|
cache-to: type=gha,scope=floci-native,mode=max
|
|
|
|
- name: Build and publish compat image
|
|
id: compat
|
|
if: inputs.publish-native
|
|
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
|
|
env:
|
|
SOURCE_DATE_EPOCH: ${{ steps.metadata.outputs.source-date-epoch }}
|
|
with:
|
|
context: .
|
|
file: docker/Dockerfile.compat
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
tags: ${{ needs.prepare.outputs.image }}:${{ needs.prepare.outputs.image-tag }}-native-compat
|
|
build-args: |
|
|
VERSION=${{ needs.prepare.outputs.product-version }}
|
|
BASE_IMAGE=${{ needs.prepare.outputs.image }}@${{ steps.native.outputs.digest }}
|
|
labels: |
|
|
org.opencontainers.image.version=${{ needs.prepare.outputs.product-version }}
|
|
org.opencontainers.image.revision=${{ needs.prepare.outputs.source-sha }}
|
|
org.opencontainers.image.vcs-ref=${{ needs.prepare.outputs.source-sha }}
|
|
org.opencontainers.image.created=${{ steps.metadata.outputs.created }}
|
|
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
|
|
version=${{ needs.prepare.outputs.product-version }}
|
|
build-date=${{ steps.metadata.outputs.created }}
|
|
vcs-ref=${{ needs.prepare.outputs.source-sha }}
|
|
cache-from: type=gha,scope=floci-compat
|
|
cache-to: type=gha,scope=floci-compat,mode=max
|
|
|
|
- name: Record image provenance
|
|
id: provenance
|
|
env:
|
|
COMPAT_DIGEST: ${{ steps.compat.outputs.digest }}
|
|
CREATED: ${{ steps.metadata.outputs.created }}
|
|
IMAGE: ${{ needs.prepare.outputs.image }}
|
|
IMAGE_TAG: ${{ needs.prepare.outputs.image-tag }}
|
|
JVM_DIGEST: ${{ steps.jvm.outputs.digest }}
|
|
NATIVE_DIGEST: ${{ steps.native.outputs.digest }}
|
|
PRODUCT_VERSION: ${{ needs.prepare.outputs.product-version }}
|
|
PUBLISH_NATIVE: ${{ inputs.publish-native }}
|
|
REPOSITORY: ${{ github.repository }}
|
|
REQUESTED_SOURCE_REF: ${{ inputs.source-ref }}
|
|
RUN_ATTEMPT: ${{ github.run_attempt }}
|
|
RUN_ID: ${{ github.run_id }}
|
|
SERVER_URL: ${{ github.server_url }}
|
|
SOURCE_SHA: ${{ needs.prepare.outputs.source-sha }}
|
|
shell: bash
|
|
run: |
|
|
jvm_ref="$IMAGE:$IMAGE_TAG"
|
|
jvm_digest_ref="$IMAGE@$JVM_DIGEST"
|
|
native_ref="$IMAGE:$IMAGE_TAG-native"
|
|
compat_ref="$IMAGE:$IMAGE_TAG-native-compat"
|
|
native_digest_ref="$IMAGE@$NATIVE_DIGEST"
|
|
compat_digest_ref="$IMAGE@$COMPAT_DIGEST"
|
|
run_url="$SERVER_URL/$REPOSITORY/actions/runs/$RUN_ID/attempts/$RUN_ATTEMPT"
|
|
|
|
jq -n \
|
|
--arg sourceSha "$SOURCE_SHA" \
|
|
--arg requestedSourceRef "$REQUESTED_SOURCE_REF" \
|
|
--arg created "$CREATED" \
|
|
--arg imageTag "$IMAGE_TAG" \
|
|
--arg productVersion "$PRODUCT_VERSION" \
|
|
--arg repository "$REPOSITORY" \
|
|
--arg runId "$RUN_ID" \
|
|
--arg runAttempt "$RUN_ATTEMPT" \
|
|
--arg runUrl "$run_url" \
|
|
--arg jvmRef "$jvm_ref" \
|
|
--arg jvmDigest "$JVM_DIGEST" \
|
|
--arg jvmDigestRef "$jvm_digest_ref" \
|
|
'{source: {sha: $sourceSha, requestedRef: $requestedSourceRef, repository: $repository}, workflow: {runId: $runId, attempt: $runAttempt, url: $runUrl}, created: $created, imageTag: $imageTag, productVersion: $productVersion, images: {jvm: {ref: $jvmRef, digest: $jvmDigest, digestRef: $jvmDigestRef, dockerfile: "docker/Dockerfile"}}, platforms: ["linux/amd64", "linux/arm64"]}' \
|
|
> floci-image-provenance.json
|
|
|
|
if [[ "$PUBLISH_NATIVE" == "true" ]]; then
|
|
jq \
|
|
--arg nativeRef "$native_ref" \
|
|
--arg nativeDigest "$NATIVE_DIGEST" \
|
|
--arg nativeDigestRef "$native_digest_ref" \
|
|
--arg compatRef "$compat_ref" \
|
|
--arg compatDigest "$COMPAT_DIGEST" \
|
|
--arg compatDigestRef "$compat_digest_ref" \
|
|
'.images.native = {ref: $nativeRef, digest: $nativeDigest, digestRef: $nativeDigestRef, dockerfile: "docker/Dockerfile.native-package"}
|
|
| .images.compat = {ref: $compatRef, digest: $compatDigest, digestRef: $compatDigestRef, dockerfile: "docker/Dockerfile.compat", base: $nativeDigestRef}' \
|
|
floci-image-provenance.json > floci-image-provenance.tmp
|
|
mv floci-image-provenance.tmp floci-image-provenance.json
|
|
fi
|
|
|
|
{
|
|
echo "jvm-ref=$jvm_ref"
|
|
echo "jvm-digest-ref=$jvm_digest_ref"
|
|
if [[ "$PUBLISH_NATIVE" == "true" ]]; then
|
|
echo "native-ref=$native_ref"
|
|
echo "native-digest-ref=$native_digest_ref"
|
|
echo "compat-ref=$compat_ref"
|
|
echo "compat-digest-ref=$compat_digest_ref"
|
|
fi
|
|
} >> "$GITHUB_OUTPUT"
|
|
|
|
{
|
|
echo "## Floci images"
|
|
echo
|
|
echo "Source: \`$SOURCE_SHA\`"
|
|
echo "Product version: \`$PRODUCT_VERSION\`"
|
|
echo
|
|
echo "| Image tag | Immutable digest reference |"
|
|
echo "| --- | --- |"
|
|
echo "| \`$jvm_ref\` | \`$jvm_digest_ref\` |"
|
|
if [[ "$PUBLISH_NATIVE" == "true" ]]; then
|
|
echo "| \`$native_ref\` | \`$native_digest_ref\` |"
|
|
echo "| \`$compat_ref\` | \`$compat_digest_ref\` |"
|
|
fi
|
|
} >> "$GITHUB_STEP_SUMMARY"
|
|
|
|
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
with:
|
|
name: floci-image-provenance-${{ needs.prepare.outputs.image-tag }}
|
|
path: floci-image-provenance.json
|
|
if-no-files-found: error
|
|
retention-days: 30
|