Skip to content

release

release #100

Workflow file for this run

name: release
on:
workflow_dispatch:
inputs:
registry:
description: 'Container registry prefix (e.g., ghcr.io/trinodb)'
required: false
default: 'ghcr.io/trinodb'
jobs:
prepare:
runs-on: ubuntu-24.04
permissions:
contents: write
outputs:
commit_sha: ${{ steps.release.outputs.COMMIT_SHA }}
steps:
- uses: actions/checkout@v6
- name: Configure Git user
run: |
git config user.email "releases@trinodb.io"
git config user.name "Trino release automation"
- name: Create release commit
id: release
run: |
if ! grep -q '^[0-9]\+-SNAPSHOT$' version; then
echo "Error: version file must contain SNAPSHOT version (e.g., 124-SNAPSHOT)"
exit 1
fi
sed -i 's/^\([0-9]\+\)-SNAPSHOT$/\1/' version
VERSION=$(cat version)
git commit -a -m "Release: $VERSION"
git push origin HEAD:master
echo "COMMIT_SHA=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
release-amd64:
needs: prepare
runs-on: ubuntu-24.04
permissions:
packages: write
env:
REGISTRY: ${{ inputs.registry }}
steps:
- uses: actions/checkout@v6
with:
ref: ${{ needs.prepare.outputs.commit_sha }}
- name: Free up disk space
run: ./.github/bin/free-disk-space.sh
- name: Log in to the Container registry
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Install crane
uses: imjasonh/setup-crane@31b88efe9de28ae0ffa220711af4b60be9435f6e # v0.4
- name: Build and push amd64 images
run: |
single_arch=(
testing/hdp3.1-hive
testing/hdp3.1-hive-kerberized
testing/hdp3.1-hive-kerberized-2
testing/hdp3.1-hive-kerberized-kms
)
multi_arch=(
build/sphinx
testing/almalinux9-oj11
testing/almalinux9-oj17
testing/almalinux9-oj17-openldap
testing/almalinux9-oj17-openldap-referrals
testing/almalinux9-oj17-openldap-active-directory
testing/hive3.1
testing/hive3.1-hive
testing/hive3.1-kerberos
testing/iceberg-rest
testing/kdc
testing/kerberos
testing/spark4-delta
testing/spark4-iceberg
testing/spark3-hudi
testing/hive4.0-hive
)
mkdir -p /tmp/refs
# Build and push single_arch (amd64-only) images by digest
for image in "${single_arch[@]}"; do
make "$image"
SAFE_NAME="${image//\//-}"
docker save "${image}:latest" -o /tmp/image.tar
crane push /tmp/image.tar "${REGISTRY}/${image}" --image-refs "/tmp/refs/${SAFE_NAME}"
done
# Build and push multi_arch amd64 images by digest
for image in "${multi_arch[@]}"; do
make "$image"
SAFE_NAME="${image//\//-}"
docker save "${image}:latest" -o /tmp/image.tar
crane push /tmp/image.tar "${REGISTRY}/${image}" --image-refs "/tmp/refs/${SAFE_NAME}-linux-amd64"
done
- name: Upload refs
uses: actions/upload-artifact@v4
with:
name: refs-amd64
path: /tmp/refs/*
release-arm64:
needs: prepare
runs-on: ubuntu-24.04-arm
permissions:
packages: write
env:
REGISTRY: ${{ inputs.registry }}
steps:
- uses: actions/checkout@v6
with:
ref: ${{ needs.prepare.outputs.commit_sha }}
- name: Free up disk space
run: ./.github/bin/free-disk-space.sh
- name: Log in to the Container registry
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Install crane
uses: imjasonh/setup-crane@31b88efe9de28ae0ffa220711af4b60be9435f6e # v0.4
- name: Build and push arm64 images
run: |
multi_arch=(
build/sphinx
testing/almalinux9-oj11
testing/almalinux9-oj17
testing/almalinux9-oj17-openldap
testing/almalinux9-oj17-openldap-referrals
testing/almalinux9-oj17-openldap-active-directory
testing/hive3.1
testing/hive3.1-hive
testing/hive3.1-kerberos
testing/hive4.0-hive
testing/iceberg-rest
testing/kdc
testing/kerberos
testing/spark4-delta
testing/spark4-iceberg
testing/spark3-hudi
)
mkdir -p /tmp/refs
# Build and push multi_arch arm64 images by digest
for image in "${multi_arch[@]}"; do
make "$image"
SAFE_NAME="${image//\//-}"
docker save "${image}:latest" -o /tmp/image.tar
crane push /tmp/image.tar "${REGISTRY}/${image}" --image-refs "/tmp/refs/${SAFE_NAME}-linux-arm64"
done
- name: Upload refs
uses: actions/upload-artifact@v4
with:
name: refs-arm64
path: /tmp/refs/*
create-manifests:
needs: [prepare, release-amd64, release-arm64]
runs-on: ubuntu-24.04
permissions:
packages: write
env:
REGISTRY: ${{ inputs.registry }}
steps:
- uses: actions/checkout@v6
with:
ref: ${{ needs.prepare.outputs.commit_sha }}
- name: Log in to the Container registry
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Install crane
uses: imjasonh/setup-crane@31b88efe9de28ae0ffa220711af4b60be9435f6e # v0.4
- name: Download refs
uses: actions/download-artifact@v4
with:
path: /tmp/refs
pattern: refs-*
merge-multiple: true
- name: Set version from file
run: echo "VERSION=$(cat version)" >> $GITHUB_ENV
- name: Create and push manifests
run: |
single_arch=(
testing/hdp3.1-hive
testing/hdp3.1-hive-kerberized
testing/hdp3.1-hive-kerberized-2
testing/hdp3.1-hive-kerberized-kms
)
multi_arch=(
build/sphinx
testing/almalinux9-oj11
testing/almalinux9-oj17
testing/almalinux9-oj17-openldap
testing/almalinux9-oj17-openldap-referrals
testing/almalinux9-oj17-openldap-active-directory
testing/hive3.1
testing/hive3.1-hive
testing/hive3.1-kerberos
testing/hive4.0-hive
testing/iceberg-rest
testing/kdc
testing/kerberos
testing/spark4-delta
testing/spark4-iceberg
testing/spark3-hudi
)
# Tag single_arch (amd64-only) images with final version
for image in "${single_arch[@]}"; do
SAFE_NAME="${image//\//-}"
REF=$(cat "/tmp/refs/${SAFE_NAME}")
crane tag "$REF" "${VERSION}"
done
# Create multi-arch manifests for images with both platforms
for image in "${multi_arch[@]}"; do
SAFE_NAME="${image//\//-}"
AMD64_REF=$(cat "/tmp/refs/${SAFE_NAME}-linux-amd64")
ARM64_REF=$(cat "/tmp/refs/${SAFE_NAME}-linux-arm64")
crane index append -t "${REGISTRY}/${image}:${VERSION}" \
-m "$AMD64_REF" \
-m "$ARM64_REF"
done
finalize:
needs: [prepare, create-manifests]
runs-on: ubuntu-24.04
permissions:
contents: write
steps:
- uses: actions/checkout@v6
with:
ref: ${{ needs.prepare.outputs.commit_sha }}
- name: Configure Git user
run: |
git config user.email "releases@trinodb.io"
git config user.name "Trino release automation"
- name: Create release tag
run: |
VERSION=$(cat version)
git tag -m "" "$VERSION"
- name: Create next development version
run: |
VERSION=$(cat version)
((VERSION++))
echo "$VERSION-SNAPSHOT" > version
git commit -a -m "Prepare for next development iteration"
- name: Push changes
run: git push --tags origin HEAD:master