1+ name : Presto Stable - Prepare Release
2+
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ skip_release_cut :
7+ description : ' Skip cutting release branch'
8+ type : boolean
9+ default : false
10+ required : false
11+
12+ jobs :
13+ cut-release :
14+ if : ${{ !inputs.skip_release_cut }}
15+ runs-on : ubuntu-latest
16+ environment : release
17+ permissions :
18+ contents : write
19+
20+ steps :
21+ - name : Check for master branch
22+ if : ${{ github.ref != 'refs/heads/master' }}
23+ run : echo "Invalid branch. This action can only be run on the master branch." && exit 1
24+
25+ - name : Checkout presto source
26+ uses : actions/checkout@v4
27+ with :
28+ token : ${{ secrets.PRESTODB_CI_TOKEN }}
29+ ref : master
30+ show-progress : false
31+
32+ - name : Set up JDK 11
33+ uses : actions/setup-java@v4
34+ with :
35+ java-version : ' 11'
36+ distribution : ' temurin'
37+
38+ - name : Configure git
39+ run : |
40+ git config --global --add safe.directory ${{github.workspace}}
41+ git config --global user.email "[email protected] " 42+ git config --global user.name "prestodb-ci"
43+ git config pull.rebase false
44+
45+ - name : Set maven version
46+ run : |
47+ unset MAVEN_CONFIG && ./mvnw versions:set -DremoveSnapshot -ntp
48+
49+ - name : Get Presto release version
50+ id : get-version
51+ run : |
52+ PRESTO_RELEASE_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \
53+ -Dexpression=project.version -q -ntp -DforceStdout | tail -n 1)
54+ echo "PRESTO_RELEASE_VERSION=$PRESTO_RELEASE_VERSION" >> $GITHUB_ENV
55+ echo "PRESTO_RELEASE_VERSION=$PRESTO_RELEASE_VERSION"
56+ echo "In case cut release failed, please delete the tag ${PRESTO_RELEASE_VERSION} and the branch release-${PRESTO_RELEASE_VERSION} manually, then re-run this action."
57+
58+ - name : Update version in master
59+ run : |
60+ git reset --hard
61+ unset MAVEN_CONFIG && ./mvnw release:prepare --batch-mode \
62+ -DskipTests \
63+ -DautoVersionSubmodules \
64+ -DdevelopmentVersion=${{ env.PRESTO_RELEASE_VERSION }} \
65+ -DreleaseVersion=${{ env.PRESTO_RELEASE_VERSION }}
66+ grep -m 1 "<version>" pom.xml
67+ git log --pretty="format:%ce: %s" -5
68+ git push --follow-tags origin master
69+
70+ - name : Push release branch
71+ run : |
72+ git checkout ${{ env.PRESTO_RELEASE_VERSION }}
73+ git switch -c release-${{ env.PRESTO_RELEASE_VERSION }}
74+ git log --pretty="format:%ce: %s" -3
75+ git push origin release-${{ env.PRESTO_RELEASE_VERSION }}
76+
77+ release-notes :
78+ needs : [cut-release]
79+ if : ${{ always() && (needs.cut-release.result == 'success' || inputs.skip_release_cut) }}
80+ runs-on : ubuntu-latest
81+ environment : release
82+ permissions :
83+ contents : write
84+
85+ steps :
86+ - name : Check for master branch
87+ if : ${{ github.ref != 'refs/heads/master' }}
88+ run : echo "Invalid branch. This action can only be run on the master branch." && exit 1
89+
90+ - name : Checkout presto source
91+ uses : actions/checkout@v4
92+ with :
93+ ref : master
94+ show-progress : false
95+
96+ - name : Set up JDK 11
97+ uses : actions/setup-java@v4
98+ with :
99+ java-version : ' 11'
100+ distribution : ' temurin'
101+
102+ - name : Configure git
103+ run : |
104+ git config --global --add safe.directory ${{github.workspace}}
105+ git config --global user.email "[email protected] " 106+ git config --global user.name "prestodb-ci"
107+ git config pull.rebase false
108+
109+ - name : Add git upstream
110+ run : |
111+ git remote add upstream ${{ github.server_url }}/${{ github.repository }}.git
112+ git fetch upstream --tags
113+ git remote -v
114+
115+ - name : Create release notes pull request
116+ run : |
117+ ./src/release/release-notes.sh ${{ github.repository_owner }} ${{ secrets.PRESTODB_CI_TOKEN }}
0 commit comments