-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Increment version in gradle.properties automatically (#3082)
* Update relase workflow to accept artifact version This updates the release workflow so that it runs when someone manually triggers it rather than on every commit. It also takes an argument for the version, which hopefully will fix some tests that are failing during the current build. It still doesn't update the build to do any of the other things we associate with releases (e.g., updating any of the values storing the current version), but it may give us insight into the release build itself. * Add script to increment version automatically and hook it into the release * increment version during release * update patch release build to merge into main at the end * remove artifact version task * update workflows based on testing * Add configuration to publish to GitHub packages and to Maven Central This adds the gradle configuration necessary to publish to maven central and GitHub packages if requested. It also then calls those methods during the release step of our GitHub actions. * separate out FDB and env setup to avoid running setup twice * verison bump * some cleanup * update to 4.1 ; add documentation about maven central * update release notes for #3111 * remove compiler.xml which is no longer necessary (as stated by the .gitignore) but will now update with every release * update versionutils.py to make more internally consistent
- Loading branch information
1 parent
c48b652
commit ce93a11
Showing
16 changed files
with
388 additions
and
160 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
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,47 @@ | ||
name: Patch Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
branch: | ||
description: 'Branch to build off of' | ||
required: true | ||
|
||
|
||
jobs: | ||
gradle: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
checks: write | ||
contents: write | ||
packages: write | ||
pages: read | ||
pull-requests: write | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4.2.2 | ||
with: | ||
ref: ${{ inputs.branch }} | ||
- name: Setup Base Environment | ||
uses: ./actions/setup-base-env | ||
- name: Setup FDB | ||
uses: ./actions/setup-fdb | ||
|
||
# Push a version bump back to main. There are failure scenarios that can result | ||
# in published artifacts but an erroneous build, so it's safer to bump the version | ||
# at the beginning | ||
- name: Configure Git | ||
run: | | ||
git config --global user.name 'FoundationDB CI' | ||
git config --global user.email 'foundationdb_ci@apple.com' | ||
- name: Increment Version | ||
run: python build/versionutils.py gradle.properties -u PATCH --increment --commit | ||
- name: Push Version Update | ||
run: git push | ||
|
||
- name: Build and publish release | ||
uses: ./actions/release-build-publish | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
MAVEN_USER: ${{ secrets.MAVEN_USER }} | ||
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} |
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
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 |
---|---|---|
@@ -1,22 +1,42 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
gradle: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
checks: write | ||
contents: read | ||
contents: write | ||
packages: write | ||
pages: write | ||
pull-requests: write | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4.2.2 | ||
- name: Run Gradle Test | ||
uses: ./actions/gradle-test | ||
with: | ||
gradle_args: "-PreleaseBuild=true" | ||
- name: Checkout sources | ||
uses: actions/checkout@v4.2.2 | ||
- name: Setup Base Environment | ||
uses: ./actions/setup-base-env | ||
- name: Setup FDB | ||
uses: ./actions/setup-fdb | ||
|
||
# Push a version bump back to main. There are failure scenarios that can result | ||
# in published artifacts but an erroneous build, so it's safer to bump the version | ||
# at the beginning | ||
- name: Configure git | ||
run: | | ||
git config --global user.name 'FoundationDB CI' | ||
git config --global user.email 'foundationdb_ci@apple.com' | ||
- name: Increment version | ||
run: python build/versionutils.py gradle.properties --increment --commit | ||
- name: Push version increment | ||
run: git push | ||
|
||
- name: Build and publish | ||
uses: ./actions/release-build-publish | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
MAVEN_USER: ${{ secrets.MAVEN_USER }} | ||
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} | ||
|
||
# TODO: Publish documentation updates |
This file was deleted.
Oops, something went wrong.
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
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,53 @@ | ||
name: Build and publish release | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Get version | ||
id: get_version | ||
shell: bash | ||
run: | | ||
echo "version=$(python build/versionutils.py gradle.properties)" >> "$GITHUB_OUTPUT" | ||
- name: Run Gradle Test | ||
uses: ./actions/gradle-test | ||
with: | ||
gradle_args: -PreleaseBuild=true -PpublishBuild=true | ||
- name: Publish Artifacts | ||
uses: ./actions/run-gradle | ||
with: | ||
gradle_command: publish -PreleaseBuild=true -PpublishBuild=true -PgithubPublish=true -PcentralPublish=true | ||
|
||
# Post release: Update various files which reference version | ||
- name: Update release notes | ||
shell: bash | ||
run: ARTIFACT_VERSION="${{ steps.get_version.outputs.version }}" ./build/update_release_notes.bash | ||
- name: Update YAML test file versions | ||
uses: ./actions/run-gradle | ||
with: | ||
gradle_command: updateYamsql -PreleaseBuild=true | ||
- name: Commit YAML updates | ||
shell: bash | ||
run: python ./build/commit_yamsql_updates.py "${{ steps.get_version.outputs.version }}" | ||
|
||
# Create and push the tag | ||
- name: Create tag | ||
shell: bash | ||
run: git tag -m "Release ${{ steps.get_version_outputs.version }}" -f "${{ steps.get_version.outputs.version }}" | ||
- name: Push tag | ||
shell: bash | ||
run: git push origin "${{ steps.get_version.outputs.version }}" | ||
- name: Push Updates | ||
id: push_updates | ||
shell: bash | ||
run: git push origin | ||
- name: Create Merge PR if conflict | ||
if: failure() && steps.push_updates.conclusion == 'failure' | ||
uses: peter-evans/create-pull-request@v7 | ||
id: pr_on_conflict | ||
with: | ||
branch: release-build | ||
branch-suffix: timestamp | ||
title: "Updates for ${{ steps.get_version.outputs.version }} release" | ||
sign-commits: true | ||
body: | | ||
Updates from release for version ${{ steps.get_version.outputs.version }}. Conflicts during the build prevented automatic updating. Please resolve conflicts by checking out the current branch, merging, and then deleting this branch. |
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,16 @@ | ||
name: Run Gradle | ||
|
||
inputs: | ||
gradle_command: | ||
description: 'Gradle command to run' | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Remove JVM args | ||
shell: bash | ||
run: sed -i -e "s/^org\.gradle\..*/#&/g" gradle.properties | ||
- name: Run Command | ||
shell: bash | ||
run: GRADLE_OPTS="-XX:+HeapDumpOnOutOfMemoryError -Xverify:none -XX:+TieredCompilation -Xmx4096m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED" ./gradlew --no-daemon --console=plain -b ./build.gradle ${{ inputs.gradle_command }} |
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,16 @@ | ||
name: Setup Base Environment | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4.7.0 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.13' |
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,29 @@ | ||
name: Setup FDB | ||
|
||
inputs: | ||
fdb_version: | ||
description: 'Version of FDB to run' | ||
required: false | ||
default: "7.3.42" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Download FDB Client | ||
shell: bash | ||
run: wget -nv https://github.com/apple/foundationdb/releases/download/${{ inputs.fdb_version }}/foundationdb-clients_${{ inputs.fdb_version }}-1_amd64.deb | ||
- name: Download FDB Server | ||
shell: bash | ||
run: wget -nv https://github.com/apple/foundationdb/releases/download/${{ inputs.fdb_version }}/foundationdb-server_${{ inputs.fdb_version }}-1_amd64.deb | ||
- name: Install FDB Server | ||
shell: bash | ||
run: sudo dpkg -i foundationdb-clients_${{ inputs.fdb_version }}-1_amd64.deb foundationdb-server_${{ inputs.fdb_version }}-1_amd64.deb | ||
- name: Fix FDB Network Addresses | ||
shell: bash | ||
run: sudo sed -i -e "s/public_address = auto:\$ID/public_address = 127.0.0.1:\$ID/g" -e "s/listen_address = public/listen_address = 0.0.0.0:\$ID/g" /etc/foundationdb/foundationdb.conf | ||
- name: Start FDB Server | ||
shell: bash | ||
run: sudo /usr/lib/foundationdb/fdbmonitor /etc/foundationdb/foundationdb.conf --daemonize | ||
- name: Switch FDB to SSD | ||
shell: bash | ||
run: fdbcli --exec "configure single ssd storage_migration_type=aggressive; status" |
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
Oops, something went wrong.