diff --git a/.github/workflows/sql-release.yml b/.github/workflows/sql-release.yml index 27be3d0b8e5..133a14024b3 100644 --- a/.github/workflows/sql-release.yml +++ b/.github/workflows/sql-release.yml @@ -32,6 +32,7 @@ jobs: uses: arduino/setup-protoc@v1 with: repo-token: ${{ secrets.GITHUB_TOKEN }} + version: '3.20.3' - name: Authenticate GCS uses: google-github-actions/auth@v0 with: @@ -46,6 +47,7 @@ jobs: shell: bash run: | cd sql + mvn test mvn package -Pnative-lib - name: Install zip on Windows if: matrix.os == 'windows' diff --git a/.github/workflows/sql-test.yml b/.github/workflows/sql-test.yml index 4fbbbf94aa2..bb7ec0da79b 100644 --- a/.github/workflows/sql-test.yml +++ b/.github/workflows/sql-test.yml @@ -27,14 +27,14 @@ jobs: version: "22.1.0" java-version: "17" components: "native-image" - - name: Install Protoc uses: arduino/setup-protoc@v1 with: repo-token: ${{ secrets.GITHUB_TOKEN }} - + version: '3.20.3' - name: Build native library shell: bash run: | cd sql + mvn test mvn package -Pnative-lib diff --git a/.github/workflows/sql-version-check.yml b/.github/workflows/sql-version-check.yml new file mode 100644 index 00000000000..d7e7968b6d9 --- /dev/null +++ b/.github/workflows/sql-version-check.yml @@ -0,0 +1,38 @@ +name: Check version update on approval +on: + pull_request_review: + types: + - submitted + pull_request: + paths: + - "sql/**" + - ".github/workflows/sql-test.yml" +jobs: + version_increment: + runs-on: ubuntu-latest + if: github.event.review.state == 'approved' || github.eventname = 'pull_request' + steps: + - uses: actions/checkout@v3 + - uses: actions/checkout@v3 + with: + ref: main + path: main_repo + - name: Increment patch version + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # 'gh pr' is required because the checkout action does not checkout the PR branch (see https://github.com/actions/checkout/issues/124) + run: | + cd main_repo/sql + MAIN_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) + cd ../../sql + PR_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) + if [[ $MAIN_VERSION == $PR_VERSION ]]; then + mvn validate -Pbump-patch + gh pr checkout ${{ github.event.pull_request.number }} + git config user.name github-actions + git config user.email github-actions@github.com + git add pom.xml + NEW_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) + git commit -m "SQL version updated to $NEW_VERSION" + git push + fi diff --git a/sql/.mvn/maven.config b/sql/.mvn/maven.config new file mode 100644 index 00000000000..4548a431f6f --- /dev/null +++ b/sql/.mvn/maven.config @@ -0,0 +1 @@ +--batch-mode -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn diff --git a/sql/pom.xml b/sql/pom.xml index 1511b74f8e7..377b360b4c8 100644 --- a/sql/pom.xml +++ b/sql/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.rilldata sql - 0.1.0-SNAPSHOT + 0.1.1 3.8.1 false @@ -26,7 +26,7 @@ 5.8.1 0.10.2 2.3.4 - 3.21.5 + 3.20.3 0.23.0 @@ -119,8 +119,10 @@ ${compiler-plugin.version} - -parameters + -parameters --enable-preview + 17 + 17 @@ -286,6 +288,12 @@ + + parse-version + + parse-version + + @@ -295,6 +303,7 @@ exec-maven-plugin org.codehaus.mojo + 3.1.0 Generate protobuf classes @@ -333,6 +342,33 @@ + + bump-patch + + + bumpPatch + + + + + + org.codehaus.mojo + versions-maven-plugin + + + + set + + validate + + ${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.nextIncrementalVersion} + + + + + + + native-lib