release #60
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
on: | |
workflow_dispatch: {} | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
steps: | |
- name: Free up disk space | |
run: | | |
sudo rm -rf \ | |
/usr/share/dotnet \ | |
/opt/ghc \ | |
/usr/local/share/boost \ | |
"$AGENT_TOOLSDIRECTORY" || true | |
docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true | |
- name: Report disk space usage | |
run: | | |
sudo dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -nr | head | |
df -h . | |
sudo du -hx -d 4 --threshold=1G /usr/ | sort -hr | head | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # checkout tags so version in Manifest is set properly | |
- name: Configure Git user | |
run: | | |
git config user.email "releases@trinodb.io" | |
git config user.name "Trino release automation" | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Log in to the Container registry | |
# locked to https://github.com/docker/login-action/releases/tag/v2.1.0 | |
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set release version | |
run: | | |
# if there's a SNAPSHOT suffix, remove it and commit changes | |
DO_RELEASE=false | |
if grep -q '^[0-9]\+-SNAPSHOT$' version; then | |
sed -i 's/^\([0-9]\+\)-SNAPSHOT$/\1/' version | |
VERSION=$(cat version) | |
git diff | |
git commit -a -m "Release: $VERSION" | |
git tag -m "" "$VERSION" | |
# Verify tag was created and points to the release commit | |
git show tags/"$VERSION" | |
DO_RELEASE=true | |
fi | |
VERSION=$(cat version) | |
echo "VERSION=${VERSION}" >> $GITHUB_ENV | |
echo "DO_RELEASE=${DO_RELEASE}" >> $GITHUB_ENV | |
- name: Make release | |
run: | | |
if [ "$DO_RELEASE" != "true" ]; then | |
echo "Skipping the release step because not starting from a snapshot version" | |
exit 0 | |
fi | |
skipped_images=( | |
testing/almalinux9-oj17-openldap-base | |
) | |
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=( | |
testing/almalinux9-oj11 | |
testing/almalinux9-oj17 | |
testing/almalinux9-oj17-openldap | |
testing/almalinux9-oj17-openldap-referrals | |
testing/almalinux9-oj17-openldap-active-directory | |
testing/hive3.1-hive | |
testing/kerberos | |
testing/phoenix5 | |
testing/spark3-delta | |
testing/spark3-iceberg | |
testing/spark3-hudi | |
testing/polaris-catalog | |
testing/unity-catalog | |
) | |
referenced_images=("${skipped_images[@]}" "${single_arch[@]}" "${multi_arch[@]}") | |
make meta | |
read -a images < <(make list) | |
export LC_ALL=C | |
mapfile -t ignored < <( \ | |
comm -23 \ | |
<(printf '%s\n' "${images[@]}" | sort) \ | |
<(printf '%s\n' "${referenced_images[@]}" | sort) \ | |
) | |
if [ "${#ignored[@]}" -ne 0 ]; then | |
echo "Images that would not get released: ${ignored[*]}" | |
echo "Must be explicitly added to either single_arch or multi_arch list or should be added to skipped list" | |
exit 2 | |
fi | |
make prepare-release | |
make "${single_arch[@]/%/@$VERSION}" | |
# free up disk space | |
docker system prune --volumes | |
make "${multi_arch[@]/%/@$VERSION}" PLATFORMS="linux/amd64,linux/arm64" | |
single_remote=("${single_arch[@]/#/ghcr.io/trinodb/}") | |
./bin/push.sh "${single_remote[@]/%/:$VERSION}" | |
export PLATFORMS="linux/amd64,linux/arm64" | |
multi_remote=("${multi_arch[@]/#/ghcr.io/trinodb/}") | |
./bin/push.sh "${multi_remote[@]/%/:$VERSION}" | |
- name: Set next development version | |
run: | | |
((VERSION++)) | |
echo "$VERSION-SNAPSHOT" > version | |
git diff | |
git commit -a -m "Prepare for next development iteration" | |
# Show the contents of the commit | |
git show HEAD | |
git push --tags origin master |