Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add publish presto release action and fix cut release action #24532

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
name: Presto Stable Release Workflow
name: Cut Presto Stable Release

on:
workflow_dispatch:

jobs:
presto-release:
name: Presto Stable Release Workflow
cut-stable-release:
runs-on: ubuntu-latest
environment: release

Expand Down Expand Up @@ -60,11 +59,15 @@ jobs:
-DautoVersionSubmodules \
-DdevelopmentVersion=${{ env.PRESTO_RELEASE_VERSION }} \
-DreleaseVersion=${{ env.PRESTO_RELEASE_VERSION }}
grep -m 1 "<version>" pom.xml
git log --pretty="format:%ce: %s" -5
git push --follow-tags origin master

- name: Push release branch
env:
PRESTO_RELEASE_VERSION: ${{ steps.get-version.outputs.PRESTO_RELEASE_VERSION }}
run: |
git checkout -b release-${{ env.PRESTO_RELEASE_VERSION }}
git checkout ${{ env.PRESTO_RELEASE_VERSION }}
git switch -c release-${{ env.PRESTO_RELEASE_VERSION }}
git log --pretty="format:%ce: %s" -3
git push origin release-${{ env.PRESTO_RELEASE_VERSION }}
111 changes: 111 additions & 0 deletions .github/workflows/presto-release-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: Publish Presto Stable Release

on:
workflow_dispatch:
inputs:
RELEASE_BRANCH:
description: 'Release branch (e.g., release-0.290)'
required: true
RELEASE_VERSION:
description: 'Release version (e.g., 0.290)'
required: true

jobs:
publish-stable-release:
runs-on: ubuntu-latest
environment: release
timeout-minutes: 300 # 5 hours

env:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}

steps:
- name: Setup JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential git gpg python3 python3-venv

- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.RELEASE_BRANCH }}
token: ${{ secrets.PRESTODB_CI_TOKEN }}
fetch-depth: 0
fetch-tags: true

- name: Configure Git
run: |
git config --global user.email "[email protected]"
git config --global user.name "prestodb-ci"
git checkout ${{ github.event.inputs.RELEASE_VERSION }}
git log --pretty="format:%ce: %s" -5

- name: Import GPG key
run: |
echo "${{ secrets.GPG_SECRET }}" > ${{ github.workspace }}/secret-key.gpg
chmod 600 ${{ github.workspace }}/secret-key.gpg
gpg --import --batch ${{ github.workspace }}/secret-key.gpg
rm -f ${{ github.workspace }}/secret-key.gpg
gpg --list-secret-keys
echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf
env:
GPG_TTY: $(tty)

- name: Create Maven Settings
run: |
cat > ${{ github.workspace }}/settings.xml << 'EOL'
<settings>
<servers>
<server>
<id>sonatype-nexus-snapshots</id>
<username>${env.NEXUS_USERNAME}</username>
<password>${env.NEXUS_PASSWORD}</password>
</server>
<server>
<id>sonatype.snapshots</id>
<username>${env.NEXUS_USERNAME}</username>
<password>${env.NEXUS_PASSWORD}</password>
</server>
<server>
<id>ossrh</id>
<username>${env.NEXUS_USERNAME}</username>
<password>${env.NEXUS_PASSWORD}</password>
</server>
</servers>
<profiles>
<profile>
<id>nexus</id>
<!--Enable snapshots for the built in central repo to direct -->
<!--all requests to nexus via the mirror -->
</profile>
</profiles>
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>
EOL

- name: Release Maven Artifacts
run: |
unset MAVEN_CONFIG
./mvnw -s ${{ github.workspace }}/settings.xml -V -B -U -e -T1C deploy \
-Dgpg.passphrase="${{ secrets.GPG_PASSPHRASE }}" \
-Dmaven.wagon.http.retryHandler.count=8 \
-DskipTests \
-DstagingProfileId=28a0d8c4350ed \
-DkeepStagingRepositoryOnFailure=true \
-DkeepStagingRepositoryOnCloseRuleFailure=true \
-DautoReleaseAfterClose=true \
-DstagingProgressTimeoutMinutes=60 \
-Poss-release \
-Pdeploy-to-ossrh \
-pl '!presto-test-coverage'
env:
GPG_TTY: $(tty)
Loading