Skip to content

Commit

Permalink
Migrate presto stable release pipeline from jenkins to github actions (
Browse files Browse the repository at this point in the history
  • Loading branch information
unidevel authored Jan 22, 2025
1 parent 84c6730 commit 15fd5d8
Showing 1 changed file with 64 additions and 0 deletions.
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 }}

0 comments on commit 15fd5d8

Please sign in to comment.