1 name: Automated Release
14 runs-on: ubuntu-latest
16 commit_count: ${{ steps.commits.outputs.count }}
17 previous_version: ${{ steps.last_release.outputs.version }}
18 release_version: ${{ steps.release.outputs.version }}
21 name: Clone Git Repository
22 uses: actions/checkout@v4
26 name: Fetch last release info
27 run: echo "tag=$(gh release view --json tagName --jq '.tagName')" >> $GITHUB_OUTPUT
29 GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32 run: echo "count=$(git rev-list --count ${{ steps.last_release.outputs.tag }}..HEAD) -- pom.xml yosql-codegen yosql-internals yosql-models yosql-tooling" >> $GITHUB_OUTPUT
34 name: Create Release Version
35 if: steps.commits.outputs.count > 0
36 run: echo "version=$(date +'%Y.%-m.%-d')" >> $GITHUB_OUTPUT
39 if: steps.commits.outputs.count > 0
40 run: echo "iso8601=$(date --utc --iso-8601=seconds)" >> $GITHUB_OUTPUT
42 name: Build Maven Tooling
44 runs-on: ubuntu-latest
47 name: Clone Git Repository
48 if: needs.prepare.outputs.commit_count > 0
49 uses: actions/checkout@v4
52 if: needs.prepare.outputs.commit_count > 0
53 uses: actions/setup-java@v4
55 java-version: ${{ env.JAVA_VERSION }}
56 java-package: ${{ env.JAVA_PACKAGE }}
57 architecture: ${{ env.JAVA_ARCH }}
58 distribution: ${{ env.JAVA_DISTRO }}
60 server-username: MAVEN_CENTRAL_USERNAME
61 server-password: MAVEN_CENTRAL_TOKEN
65 if: needs.prepare.outputs.commit_count > 0
66 uses: timheuer/base64-to-file@v1.2
68 fileName: signing.key.asc
69 fileDir: ${{ github.workspace}}
70 encodedString: ${{ secrets.GPG_SECRET_KEY_BASE64 }}
71 - name: Set release version
72 if: needs.prepare.outputs.commit_count > 0
73 run: mvn --batch-mode versions:set --define newVersion=${{ needs.prepare.outputs.release_version }} --define generateBackupPoms=false
74 - id: deploy-maven-tooling
75 name: Deploy Maven Tooling
76 if: needs.prepare.outputs.commit_count > 0
77 run: MAVEN_OPTS="--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED" mvn --batch-mode --activate-profiles release --projects yosql-tooling/yosql-tooling-maven --also-make install deploy --define pgp.secretkey=keyfile:signing.key.asc --define pgp.passphrase=literal:${{ secrets.GPG_SECRET_KEY_PASSWORD }}
79 MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
80 MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
82 name: Build Gradle Tooling
84 runs-on: ubuntu-latest
87 name: Clone Git Repository
88 if: needs.prepare.outputs.commit_count > 0
89 uses: actions/checkout@v4
92 if: needs.prepare.outputs.commit_count > 0
93 uses: actions/setup-java@v4
95 java-version: ${{ env.JAVA_VERSION }}
96 java-package: ${{ env.JAVA_PACKAGE }}
97 architecture: ${{ env.JAVA_ARCH }}
98 distribution: ${{ env.JAVA_DISTRO }}
100 - name: Set release version
101 if: needs.prepare.outputs.commit_count > 0
102 run: mvn --batch-mode versions:set --define newVersion=${{ needs.prepare.outputs.release_version }} --define generateBackupPoms=false
103 - id: install-maven-tooling
104 name: Install Maven Tooling
105 if: needs.prepare.outputs.commit_count > 0
106 run: mvn --batch-mode install
108 name: Build Gradle Tooling
109 if: needs.prepare.outputs.commit_count > 0
110 run: cd ./yosql-examples/yosql-examples-gradle/ && ./gradlew build -Pversion=${{ needs.prepare.outputs.release_version }}
112 name: Deploy Gradle Tooling
113 if: needs.prepare.outputs.commit_count > 0
114 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 }}
116 name: Build Ant Tooling
118 runs-on: ubuntu-latest
121 name: Clone Git Repository
122 if: needs.prepare.outputs.commit_count > 0
123 uses: actions/checkout@v4
126 if: needs.prepare.outputs.commit_count > 0
127 uses: actions/setup-java@v4
129 java-version: ${{ env.JAVA_VERSION }}
130 java-package: ${{ env.JAVA_PACKAGE }}
131 architecture: ${{ env.JAVA_ARCH }}
132 distribution: ${{ env.JAVA_DISTRO }}
136 if: needs.prepare.outputs.commit_count > 0
137 uses: timheuer/base64-to-file@v1.2
139 fileName: signing.key.asc
140 fileDir: ${{ github.workspace}}
141 encodedString: ${{ secrets.GPG_SECRET_KEY_BASE64 }}
142 - name: Set release version
143 if: needs.prepare.outputs.commit_count > 0
144 run: mvn --batch-mode versions:set --define newVersion=${{ needs.prepare.outputs.release_version }} --define generateBackupPoms=false
145 - id: build-ant-tooling
146 name: Build Ant Tooling
147 if: needs.prepare.outputs.commit_count > 0
148 run: mvn --batch-mode --activate-profiles release --projects yosql-tooling/yosql-tooling-ant --also-make install --define pgp.secretkey=keyfile:signing.key.asc --define pgp.passphrase=literal:${{ secrets.GPG_SECRET_KEY_PASSWORD }}
149 - id: upload-ant-tooling
150 name: Upload Ant Tooling Artifact
151 if: needs.prepare.outputs.commit_count > 0
152 uses: actions/upload-artifact@v4
154 name: yosql-tooling-ant
155 path: ./yosql-tooling/yosql-tooling-ant/target/yosql-tooling-ant-*-dist*
157 name: Build CLI Tooling on ${{ matrix.os }}
159 runs-on: ${{ matrix.os }}
168 name: Clone Git Repository
169 if: needs.prepare.outputs.commit_count > 0
170 uses: actions/checkout@v4
173 if: needs.prepare.outputs.commit_count > 0
174 uses: graalvm/setup-graalvm@v1
176 distribution: graalvm
177 java-version: ${{ env.JAVA_VERSION }}
178 github-token: ${{ secrets.GITHUB_TOKEN }}
182 if: needs.prepare.outputs.commit_count > 0
183 uses: timheuer/base64-to-file@v1
185 fileName: signing.key.asc
186 fileDir: ${{ github.workspace}}
187 encodedString: ${{ secrets.GPG_SECRET_KEY_BASE64 }}
188 - name: Set release version
189 if: needs.prepare.outputs.commit_count > 0
190 run: mvn --batch-mode --define newVersion=${{ needs.prepare.outputs.release_version }} --define generateBackupPoms=false versions:set
191 - id: build-cli-tooling
192 name: Build CLI Tooling
193 if: needs.prepare.outputs.commit_count > 0
194 run: mvn --batch-mode --activate-profiles release --projects yosql-tooling/yosql-tooling-cli --also-make install --define skipNativeBuild=false --define pgp.secretkey=keyfile:signing.key.asc --define pgp.passphrase=literal:${{ secrets.GPG_SECRET_KEY_PASSWORD }}
195 - id: upload-jvm-cli-tooling
196 name: Upload JVM CLI Tooling
197 if: needs.prepare.outputs.commit_count > 0 && runner.os == 'Linux'
198 uses: actions/upload-artifact@v4
200 name: yosql-tooling-cli-jvm
201 path: ./yosql-tooling/yosql-tooling-cli/target/yosql-tooling-cli-*-jvm*
202 - id: upload-linux-cli-tooling
203 name: Upload Linux CLI Tooling
204 if: needs.prepare.outputs.commit_count > 0 && runner.os == 'Linux'
205 uses: actions/upload-artifact@v4
207 name: yosql-tooling-cli-linux
208 path: ./yosql-tooling/yosql-tooling-cli/target/yosql-tooling-cli-*-linux*
209 - id: upload-mac-cli-tooling
210 name: Upload Mac OSX CLI Tooling
211 if: needs.prepare.outputs.commit_count > 0 && runner.os == 'macOS'
212 uses: actions/upload-artifact@v4
214 name: yosql-tooling-cli-mac
215 path: ./yosql-tooling/yosql-tooling-cli/target/yosql-tooling-cli-*-mac*
216 - id: upload-windows-cli-tooling
217 name: Upload Windows CLI Tooling
218 if: needs.prepare.outputs.commit_count > 0 && runner.os == 'Windows'
219 uses: actions/upload-artifact@v4
221 name: yosql-tooling-cli-windows
222 path: ./yosql-tooling/yosql-tooling-cli/target/yosql-tooling-cli-*-windows*
225 needs: [prepare, maven, gradle, ant, cli]
226 runs-on: ubuntu-latest
231 name: Clone Git Repository
232 if: needs.prepare.outputs.commit_count > 0
233 uses: actions/checkout@v4
237 name: Download Artifacts
238 if: needs.prepare.outputs.commit_count > 0
239 uses: actions/download-artifact@v4
244 if: needs.prepare.outputs.commit_count > 0
245 uses: softprops/action-gh-release@v2
247 tag_name: ${{ needs.prepare.outputs.release_version }}
248 token: ${{ secrets.GITHUB_TOKEN }}
251 generate_release_notes: true
253 artifacts/yosql-tooling-ant/yosql-tooling-ant-${{ needs.prepare.outputs.release_version }}-dist.zip
254 artifacts/yosql-tooling-ant/yosql-tooling-ant-${{ needs.prepare.outputs.release_version }}-dist.zip.asc
255 artifacts/yosql-tooling-ant/yosql-tooling-ant-${{ needs.prepare.outputs.release_version }}-dist.zip.sha512
256 artifacts/yosql-tooling-cli-jvm/yosql-tooling-cli-${{ needs.prepare.outputs.release_version }}-jvm.zip
257 artifacts/yosql-tooling-cli-jvm/yosql-tooling-cli-${{ needs.prepare.outputs.release_version }}-jvm.zip.asc
258 artifacts/yosql-tooling-cli-jvm/yosql-tooling-cli-${{ needs.prepare.outputs.release_version }}-jvm.zip.sha512
259 artifacts/yosql-tooling-cli-linux/yosql-tooling-cli-${{ needs.prepare.outputs.release_version }}-linux.zip
260 artifacts/yosql-tooling-cli-linux/yosql-tooling-cli-${{ needs.prepare.outputs.release_version }}-linux.zip.asc
261 artifacts/yosql-tooling-cli-linux/yosql-tooling-cli-${{ needs.prepare.outputs.release_version }}-linux.zip.sha512
262 artifacts/yosql-tooling-cli-mac/yosql-tooling-cli-${{ needs.prepare.outputs.release_version }}-mac.zip
263 artifacts/yosql-tooling-cli-mac/yosql-tooling-cli-${{ needs.prepare.outputs.release_version }}-mac.zip.asc
264 artifacts/yosql-tooling-cli-mac/yosql-tooling-cli-${{ needs.prepare.outputs.release_version }}-mac.zip.sha512
265 artifacts/yosql-tooling-cli-linux/yosql-tooling-cli-${{ needs.prepare.outputs.release_version }}-windows.zip
266 artifacts/yosql-tooling-cli-linux/yosql-tooling-cli-${{ needs.prepare.outputs.release_version }}-windows.zip.asc
267 artifacts/yosql-tooling-cli-linux/yosql-tooling-cli-${{ needs.prepare.outputs.release_version }}-windows.zip.sha512