10 PROJECT_URL: yosql.projects.metio.wtf
14 runs-on: ubuntu-latest
16 commit_count: ${{ steps.commits.outputs.count }}
17 release_version: ${{ steps.release.outputs.version }}
18 previous_version: ${{ steps.previous.outputs.version }}
19 changelog: ${{ steps.changelog.outputs.content }}
20 release_url: ${{ steps.create_release.outputs.upload_url }}
23 name: Clone Git Repository
24 uses: actions/checkout@v2
26 fetch-depth: 0 # required in order to get all tags
29 run: echo "::set-output name=count::$(git rev-list --count HEAD --since='last Sunday' -- yosql-codegen yosql-converters yosql-dao yosql-internals yosql-logging yosql-models yosql-testing yosql-tooling)"
31 name: Create Release Version
32 if: steps.commits.outputs.count > 0
33 run: echo "::set-output name=version::$(date +'%Y.%-m.%-d')"
35 name: Get Last Release
36 if: steps.commits.outputs.count > 0
37 run: echo "::set-output name=version::$(git describe --abbrev=0 --tags)"
38 - id: generate_changelog
39 name: Generate Changelog
40 if: steps.commits.outputs.count > 0
41 uses: heinrichreimer/github-changelog-generator-action@v2.2
43 token: ${{ secrets.GITHUB_TOKEN }}
49 filterByMilestone: false
50 futureRelease: ${{ steps.release.outputs.version }}
51 sinceTag: ${{ steps.previous.outputs.version }}
52 stripGeneratorNotice: true
54 - name: Check Changelog Existence
56 uses: andstor/file-existence-action@v1
59 - name: Create Empty Changelog
61 uses: 1arp/create-a-file-action@0.2
62 if: steps.check_changelog.outputs.files_exists == 'false'
66 no user facing changes
67 - name: Read Changelog
69 uses: juliangruber/read-file-action@v1
74 if: steps.commits.outputs.count > 0
75 uses: actions/create-release@v1
77 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79 tag_name: ${{ steps.release.outputs.version }}
80 release_name: ${{ steps.release.outputs.version }}
85 Write more SQL! Take a look at the [website](https://${{ env.PROJECT_URL }}/) for detailed information. **This release requires at least Java ${{ env.JAVA_VERSION }}**.
87 ${{ steps.changelog.outputs.content }}
89 name: Deploy Artifacts
90 runs-on: ubuntu-latest
94 name: Clone Git Repository
95 uses: actions/checkout@v2
96 if: needs.prepare.outputs.commit_count > 0
99 uses: actions/setup-java@v2
100 if: needs.prepare.outputs.commit_count > 0
102 java-version: ${{ env.JAVA_VERSION }}
103 java-package: ${{ env.JAVA_PACKAGE }}
104 architecture: ${{ env.JAVA_ARCH }}
105 distribution: ${{ env.JAVA_DISTRO }}
107 server-username: MAVEN_CENTRAL_USERNAME
108 server-password: MAVEN_CENTRAL_TOKEN
110 name: Cache Maven Repository
111 uses: actions/cache@v2.1.5
112 if: needs.prepare.outputs.commit_count > 0
114 path: ~/.m2/repository
115 key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
117 ${{ runner.os }}-maven-
118 - name: Set release version
119 run: mvn --batch-mode versions:set -DnewVersion=${{ needs.prepare.outputs.release_version }} -DgenerateBackupPoms=false
120 if: needs.prepare.outputs.commit_count > 0
122 name: Deploy Maven Artifacts
123 run: mvn --batch-mode install deploy
124 if: needs.prepare.outputs.commit_count > 0
126 MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
127 MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
129 name: Deploy Gradle Plugin
130 run: cd ./yosql-tooling/yosql-tooling-gradle/ && ./gradlew publishPlugins -Pversion=${{ needs.prepare.outputs.release_version }} -Pgradle.publish.key=${{ secrets.GRADLE_PUBLISH_KEY }} -Pgradle.publish.secret=${{ secrets.GRADLE_PUBLISH_SECRET }}
131 if: needs.prepare.outputs.commit_count > 0
134 runs-on: ubuntu-latest
138 benchmark: [codegen, jdbc]
141 name: Clone Git Repository
142 uses: actions/checkout@v2
143 if: needs.prepare.outputs.commit_count > 0
146 uses: actions/setup-java@v2
147 if: needs.prepare.outputs.commit_count > 0
149 java-version: ${{ env.JAVA_VERSION }}
150 java-package: ${{ env.JAVA_PACKAGE }}
151 architecture: ${{ env.JAVA_ARCH }}
152 distribution: ${{ env.JAVA_DISTRO }}
154 name: Cache Maven Repository
155 uses: actions/cache@v2.1.5
156 if: needs.prepare.outputs.commit_count > 0
158 path: ~/.m2/repository
159 key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
161 ${{ runner.os }}-maven-
163 name: Run Benchmark [${{ matrix.benchmark }}]
164 run: mvn --batch-mode --projects yosql-benchmarks/yosql-benchmarks-${{ matrix.benchmark }} --also-make --activate-profiles benchmarks verify -Dorg.slf4j.simpleLogger.log.yosql=warn -DskipTests 2>&1 1> build.log
165 if: needs.prepare.outputs.commit_count > 0
167 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
168 - id: upload-benchmark
169 name: Upload Benchmark Results
170 uses: actions/upload-artifact@v2
171 if: needs.prepare.outputs.commit_count > 0
173 name: benchmark-${{ matrix.benchmark }}
174 path: ./yosql-benchmarks/yosql-benchmarks-${{ matrix.benchmark }}/target/benchmark/yosql-benchmarks-${{ matrix.benchmark }}.json
176 name: Publish Results
177 runs-on: ubuntu-latest
181 name: Clone Git Repository
182 uses: actions/checkout@v2
183 if: needs.prepare.outputs.commit_count > 0
185 name: Download Benchmarks Results
186 uses: actions/download-artifact@v2
187 if: needs.prepare.outputs.commit_count > 0
188 - id: copy-codegen-results
189 name: Copy Codegen Results
190 run: cp ./benchmark-codegen/yosql-benchmarks-codegen.json ./yosql-website/content/benchmarks/releases/yosql-benchmarks-codegen-${{ needs.prepare.outputs.release_version }}.json
191 if: needs.prepare.outputs.commit_count > 0
192 - id: copy-jdbc-results
193 name: Copy JDBC Results
194 run: cp ./benchmark-jdbc/yosql-benchmarks-jdbc.json ./yosql-website/content/benchmarks/releases/yosql-benchmarks-jdbc-${{ needs.prepare.outputs.release_version }}.json
195 if: needs.prepare.outputs.commit_count > 0
197 name: Push Benchmarks
198 uses: stefanzweifel/git-auto-commit-action@v4
199 if: needs.prepare.outputs.commit_count > 0
201 commit_message: Add benchmark results for ${{ needs.prepare.outputs.release_version }}
202 file_pattern: "*.json"
204 name: Send Announcements
206 runs-on: ubuntu-latest
210 uses: dawidd6/action-send-mail@v2
211 if: needs.prepare.outputs.commit_count > 0
213 server_address: ${{ secrets.MAIL_SERVER }}
214 server_port: ${{ secrets.MAIL_PORT }}
215 username: ${{ secrets.MAIL_USERNAME }}
216 password: ${{ secrets.MAIL_PASSWORD }}
217 to: ${{ secrets.MAIL_TO }}
218 from: ${{ secrets.MAIL_SENDER }}
219 subject: release ${{ needs.prepare.outputs.release_version }}
220 body: See https://github.com/metio/yosql/releases/tag/${{ needs.prepare.outputs.release_version }} for details.
222 name: Send Matrix Message
223 uses: s3krit/matrix-message-action@v0.0.3
224 if: needs.prepare.outputs.commit_count > 0
226 access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
227 room_id: ${{ secrets.MATRIX_ROOM_ID }}
228 server: ${{ secrets.MATRIX_SERVER }}
229 message: release ${{ needs.prepare.outputs.release_version }} published - see https://github.com/metio/yosql/releases/tag/${{ needs.prepare.outputs.release_version }} for details