forked from prestodb/presto
-
Notifications
You must be signed in to change notification settings - Fork 3
ci: Add prepare and publish release workflows. #81
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
Open
anlowee
wants to merge
27
commits into
y-scope:release-0.293-clp-connector
Choose a base branch
from
anlowee:xwei/add-release-ci
base: release-0.293-clp-connector
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 26 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
12e4201
WIP
anlowee 66b92bd
Set the versions to 0.293-yscope
anlowee 368c806
[maven-release-plugin] prepare release 0.293-yscope
anlowee f98899a
[maven-release-plugin] prepare for next development iteration
anlowee ec67511
Reset the version number
anlowee 52bc393
Minor fix
anlowee 1f14502
REname
anlowee a771cea
Minor fix
anlowee b0417e9
Fix
anlowee b232c11
Remove release notes
anlowee a65321f
Fix
anlowee 642be22
Fix permissions
anlowee 8bd1dd4
Merge branch 'release-0.293-clp-connector' into xwei/add-release-ci
anlowee c079a4c
Fix
anlowee 0a4fb76
[maven-release-plugin] prepare branch release-preparation-0.293.0-yscope
anlowee 586beda
[maven-release-plugin] rollback changes from release preparation of r…
anlowee 2b2a206
Fix
anlowee b833607
Fix
anlowee d6dab37
fix
anlowee fe59d9d
Fix
anlowee 2461097
Modify the PR title and body
anlowee 89db6df
Fix tag
anlowee eedef63
Fix title
anlowee ec856e0
Use release:prepare
anlowee 3222966
Fix scm and fix PR title
anlowee aff82d3
Fix the harcode in maven-check
anlowee 5317ac6
Merge branch 'release-0.293-clp-connector' into xwei/add-release-ci
anlowee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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,107 @@ | ||
| name: YScope Presto - CLP Connector Stable Release - Prepare | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| prepare_release: | ||
| description: 'Prepare release branch and tag' | ||
| type: boolean | ||
| default: true | ||
| required: false | ||
|
|
||
| env: | ||
| JAVA_VERSION: ${{ vars.JAVA_VERSION || '17.0.13' }} | ||
| JAVA_DISTRIBUTION: ${{ vars.JAVA_DISTRIBUTION || 'temurin' }} | ||
| MAVEN_OPTS: ${{ vars.MAVEN_OPTS }} | ||
| GIT_CI_USER: ${{ github.actor }} | ||
| GIT_CI_EMAIL: "${{ github.actor }}@users.noreply.github.com" | ||
|
|
||
| jobs: | ||
| prepare-release-branch: | ||
| if: ${{ inputs.prepare_release }} | ||
| runs-on: ubuntu-latest | ||
| environment: release | ||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
|
|
||
| steps: | ||
| - name: Checkout presto source | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| show-progress: false | ||
| fetch-depth: 5 | ||
|
|
||
| - name: Ensure checkout latest code | ||
| run: | | ||
| git fetch origin ${{ github.ref_name }} | ||
| if [ "$(git rev-parse HEAD)" != "$(git rev-parse origin/${{ github.ref_name }})" ]; then | ||
| echo "Branch ${{ github.ref_name }} has new commits. Resetting to latest." | ||
| git reset --hard origin/${{ github.ref_name }} | ||
| else | ||
| echo "Branch ${{ github.ref_name }} is already up to date." | ||
| fi | ||
|
|
||
| - name: Set up JDK ${{ env.JAVA_DISTRIBUTION }}/${{ env.JAVA_VERSION }} | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: ${{ env.JAVA_VERSION }} | ||
| distribution: ${{ env.JAVA_DISTRIBUTION }} | ||
|
|
||
| - name: Configure git | ||
| run: | | ||
| git config --global --add safe.directory ${{github.workspace}} | ||
| git config --global user.email "${{ env.GIT_CI_EMAIL }}" | ||
| git config --global user.name "${{ env.GIT_CI_USER }}" | ||
| git config --global alias.ls 'log --pretty=format:"%cd %h %ce: %s" --date=short --no-merges' | ||
| git config pull.rebase false | ||
|
|
||
| - name: Set presto release 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_ENV | ||
| echo "PRESTO_RELEASE_VERSION=$PRESTO_RELEASE_VERSION" | ||
|
|
||
| - name: Prepare release tag and commits and push the preparation PR | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| echo "In case this job failed, please delete the branch release-preparation-${{ env.PRESTO_RELEASE_VERSION }}, and re-run the job" | ||
| git reset --hard | ||
| git switch -c release-preparation-${{ env.PRESTO_RELEASE_VERSION }} | ||
| unset MAVEN_CONFIG && ./mvnw release:prepare --batch-mode \ | ||
| -DskipTests \ | ||
| -DautoVersionSubmodules \ | ||
| -DdevelopmentVersion=${{ env.PRESTO_RELEASE_VERSION }} \ | ||
| -DreleaseVersion=${{ env.PRESTO_RELEASE_VERSION }} | ||
| grep -m 2 "<version>" pom.xml | ||
| echo "Pushing branch release-preparation-${{ env.PRESTO_RELEASE_VERSION }}" | ||
| git ls -5 | ||
| git push origin release-preparation-${{ env.PRESTO_RELEASE_VERSION }} | ||
| echo "Creating PR for branch release-preparation-${{ env.PRESTO_RELEASE_VERSION }}" | ||
| NEXT_PRESTO_RELEASE_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \ | ||
| -Dexpression=project.version -q -ntp -DforceStdout | tail -n 1) | ||
| gh pr create \ | ||
| --base release-0.293-clp-connector \ | ||
| --head "release-preparation-${{ env.PRESTO_RELEASE_VERSION }}" \ | ||
| --title "feat: Bump version to \`$NEXT_PRESTO_RELEASE_VERSION\` for next development cycle." \ | ||
| --body "Automated pull request to bump the project version for the next development cycle." | ||
|
|
||
| - name: Push release tag, and branch | ||
| run: | | ||
| echo "In case this job failed, please delete the tag ${{ env.PRESTO_RELEASE_VERSION }} and the branch release-${{ env.PRESTO_RELEASE_VERSION }}, and re-run the job" | ||
| git checkout ${{ env.PRESTO_RELEASE_VERSION }} | ||
| git switch -c release-${{ env.PRESTO_RELEASE_VERSION }} | ||
| echo "Pushing release branch release-${{ env.PRESTO_RELEASE_VERSION }} and tag ${{ env.PRESTO_RELEASE_VERSION }}" | ||
|
|
||
| echo "commits on release-${{ env.PRESTO_RELEASE_VERSION }} branch" | ||
| git ls -4 | ||
| git push origin release-${{ env.PRESTO_RELEASE_VERSION }} --tags | ||
| echo -e "\nPushed release tag to: ${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ env.PRESTO_RELEASE_VERSION }}" | ||
| echo "Pushed release branch to: ${{ github.server_url }}/${{ github.repository }}/tree/release-${{ env.PRESTO_RELEASE_VERSION }}" | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix development version passed to
mvn release:prepare.-DdevelopmentVersion=${{ env.PRESTO_RELEASE_VERSION }}sets the next development cycle to the release version without the required-SNAPSHOTsuffix. The Maven Release Plugin will either fail (because the development version must end with-SNAPSHOT) or leave the release-preparation branch stuck on the release version instead of bumping to the expected0.293.1-yscope-SNAPSHOT. Compute and pass the actual next snapshot (e.g.,0.293.1-yscope-SNAPSHOT) or let the plugin pick it automatically so the follow-up PR matches the documented flow.🤖 Prompt for AI Agents