-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate presto stable release pipeline from jenkins to github actions (…
- Loading branch information
Showing
1 changed file
with
64 additions
and
0 deletions.
There are no files selected for viewing
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
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 }} |