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

sql: release version autoincrement #983

Merged
merged 26 commits into from
Oct 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/sql-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sql-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
38 changes: 38 additions & 0 deletions .github/workflows/sql-version-check.yml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions sql/.mvn/maven.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--batch-mode -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
42 changes: 39 additions & 3 deletions sql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.rilldata</groupId>
<artifactId>sql</artifactId>
<version>0.1.0-SNAPSHOT</version>
<version>0.1.1</version>
<properties>
<compiler-plugin.version>3.8.1</compiler-plugin.version>
<failsafe.useModulePath>false</failsafe.useModulePath>
Expand All @@ -26,7 +26,7 @@
<junit.version>5.8.1</junit.version>
<reflections.version>0.10.2</reflections.version>
<hsqldb.version>2.3.4</hsqldb.version>
<protobuf.version>3.21.5</protobuf.version>
<protobuf.version>3.20.3</protobuf.version>
<druid.sql.version>0.23.0</druid.sql.version>
</properties>
<dependencies>
Expand Down Expand Up @@ -119,8 +119,10 @@
<version>${compiler-plugin.version}</version>
<configuration>
<compilerArgs>
<arg>-parameters</arg>
<arg>-parameters --enable-preview</arg>
</compilerArgs>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -286,6 +288,12 @@
</sources>
</configuration>
</execution>
<execution>
<id>parse-version</id>
<goals>
<goal>parse-version</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Custom parser generation done -->
Expand All @@ -295,6 +303,7 @@
<plugin>
<artifactId>exec-maven-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
<version>3.1.0</version>
<executions>
<execution>
<id>Generate protobuf classes</id>
Expand Down Expand Up @@ -333,6 +342,33 @@
</plugins>
</build>
<profiles>
<profile>
<id>bump-patch</id>
<activation>
<property>
<name>bumpPatch</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>set</goal>
</goals>
<phase>validate</phase>
<configuration>
<newVersion>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.nextIncrementalVersion}</newVersion>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>native-lib</id>
<build>
Expand Down