Skip to content
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

Pom #42

Closed
wants to merge 13 commits into from
48 changes: 48 additions & 0 deletions .github/workflows/autoversion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Auto-Version new contributions to Flyway Community DB Support

on:
pull_request:
branches:
- main
types:
- closed
jobs:
auto-version:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout Flyway Community DB Support
uses: actions/checkout@v4
with:
ref: main
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
cache: 'maven'
- name: Check for new module
id: check_module
run: |
git fetch origin ${{ github.event.pull_request.head.ref }}
if git diff --name-only FETCH_HEAD..HEAD -- '*/pom.xml' | grep pom.xml; then
echo "::set-output name=NEW_MODULE::true"
else
echo "::set-output name=NEW_MODULE::false"
fi
- name: Update version
run: |
if ${{ steps.check_module.outputs.NEW_MODULE }}; then
NEW_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout | awk -F'[.-]' '{print $1"."$2+1".0"}')
else
NEW_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout | awk -F'[.-]' '{print $1"."$2"."$3+1}')
fi
mvn versions:set -DnewVersion=$NEW_VERSION
git config user.email "github-buildmonkey@red-gate.com"
git config user.name "rg-buildmonkey"
git commit -am "Bump Flyway Community DB Support to $NEW_VERSION"
git tag -a -m "Flyway Community DB Support $NEW_VERSION" $NEW_VERSION
git push origin main --tags



21 changes: 21 additions & 0 deletions demo/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-community-db-support</artifactId>
<version>10.12.0</version>
</parent>

<groupId>org.example</groupId>
<artifactId>demo</artifactId>

<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

</project>
3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@
<module>flyway-database-clickhouse</module>
<module>flyway-database-oceanbase</module>
<module>flyway-database-databricks</module>
<module>demo</module>
</modules>

<properties>
<version.flyway>10.12.0</version.flyway>
<version.flyway>10.13.0</version.flyway>
</properties>

<dependencyManagement>
Expand Down
Loading