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

Migrate presto stable release pipeline from jenkins to github actions #24388

Merged
merged 1 commit into from
Jan 22, 2025
Merged
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
64 changes: 64 additions & 0 deletions .github/workflows/presto-stable-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Presto Stable Release Workflow

on:
workflow_dispatch:

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

permissions:
contents: write
packages: write

steps:
- name: Checkout Presto source
uses: actions/checkout@v4
with:
ref: master
show-progress: false

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

- name: Configure Git
run: |
git config --global --add safe.directory ${{github.workspace}}
git config --global user.email "oss-release-bot@prestodb.io"
git config --global user.name "oss-release-bot"
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git config pull.rebase false

- name: Set Maven version
run: |
unset MAVEN_CONFIG && ./mvnw versions:set -DremoveSnapshot -ntp

- name: Get Presto release version
id: get-version
run: |
PRESTO_RELEASE_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \
-Dexpression=project.version -q -ntp -DforceStdout | tail -n 1)
echo "PRESTO_RELEASE_VERSION=$PRESTO_RELEASE_VERSION" >> $GITHUB_OUTPUT

- name: Update version in master
env:
PRESTO_RELEASE_VERSION: ${{ steps.get-version.outputs.PRESTO_RELEASE_VERSION }}
run: |
git reset --hard
unset MAVEN_CONFIG && ./mvnw release:prepare --batch-mode \
-DskipTests \
-DautoVersionSubmodules \
-DdevelopmentVersion=${{ env.PRESTO_RELEASE_VERSION }} \
-DreleaseVersion=${{ env.PRESTO_RELEASE_VERSION }}
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 push origin release-${{ env.PRESTO_RELEASE_VERSION }}
Loading