diff --git a/.github/workflows/presto-stable-release.yml b/.github/workflows/presto-release-cut.yml similarity index 87% rename from .github/workflows/presto-stable-release.yml rename to .github/workflows/presto-release-cut.yml index d5ad83adecc12..2abaa0dff84f7 100644 --- a/.github/workflows/presto-stable-release.yml +++ b/.github/workflows/presto-release-cut.yml @@ -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 @@ -60,11 +59,15 @@ jobs: -DautoVersionSubmodules \ -DdevelopmentVersion=${{ env.PRESTO_RELEASE_VERSION }} \ -DreleaseVersion=${{ env.PRESTO_RELEASE_VERSION }} + grep -m 1 "" 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 }} diff --git a/.github/workflows/presto-release-publish.yml b/.github/workflows/presto-release-publish.yml new file mode 100644 index 0000000000000..916434be082c1 --- /dev/null +++ b/.github/workflows/presto-release-publish.yml @@ -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 "ci@lists.prestodb.io" + 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' + + + + sonatype-nexus-snapshots + ${env.NEXUS_USERNAME} + ${env.NEXUS_PASSWORD} + + + sonatype.snapshots + ${env.NEXUS_USERNAME} + ${env.NEXUS_PASSWORD} + + + ossrh + ${env.NEXUS_USERNAME} + ${env.NEXUS_PASSWORD} + + + + + nexus + + + + + + nexus + + + 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)