- Notifications
You must be signed in to change notification settings - Fork1
Nightly#599
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
name:Nightly | |
on: | |
schedule: | |
# Build and publish nightly snapshot at 3:55pm every day | |
-cron:"55 15 * * *" | |
workflow_dispatch: | |
inputs: | |
pr: | |
description:"Pull request#" | |
required:false | |
env: | |
JDBCX_BRANCH:"main" | |
JDBCX_VERSION:"0.6.0" | |
jobs: | |
nightly: | |
if:${{ startsWith(github.repository, 'jdbcx/') }} | |
name:"Build and Publish Nightly Snapshot" | |
runs-on:"ubuntu-latest" | |
timeout-minutes:20 | |
steps: | |
-name:Check out Git repository | |
uses:actions/checkout@v4 | |
with: | |
fetch-depth:0 | |
ref:${{ env.JDBCX_BRANCH }} | |
-name:Check out PR | |
run:| | |
git fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 \ | |
origin pull/${{ github.event.inputs.pr }}/merge:merged-pr && git checkout merged-pr | |
if:github.event.inputs.pr != '' | |
-name:Install JDK and Maven | |
uses:actions/setup-java@v4 | |
with: | |
distribution:"temurin" | |
java-version:| | |
8 | |
21 | |
cache:"maven" | |
-name:Setup Toolchain | |
shell:bash | |
run:| | |
mkdir -p $HOME/.m2 \ | |
&& cat << EOF > $HOME/.m2/toolchains.xml | |
<?xml version="1.0" encoding="UTF8"?> | |
<toolchains> | |
<toolchain> | |
<type>jdk</type> | |
<provides> | |
<version>21</version> | |
</provides> | |
<configuration> | |
<jdkHome>${{ env.JAVA_HOME }}</jdkHome> | |
</configuration> | |
</toolchain> | |
</toolchains> | |
EOF | |
-name:Update Configuration | |
run:| | |
find . -type f -name "pom.xml" -exec sed -i -e 's|${revision}|${{ env.JDBCX_VERSION }}-SNAPSHOT|g' \ | |
-e 's|^\( <version>\).*\(</version>\)$|\1${{ env.JDBCX_VERSION }}-SNAPSHOT\2|' \ | |
-e 's|${parent.groupId}|io.github.jdbcx|g' -e 's|${project.parent.groupId}|io.github.jdbcx|g' '{}' \; | |
find . -type f -name "simplelogger.*" -exec rm -fv '{}' \; | |
-name:Release Snapshot | |
uses:samuelmeuli/action-maven-publish@v1 | |
with: | |
maven_profiles:release | |
maven_args:-q --batch-mode | |
gpg_private_key:${{ secrets.GPG_PRIVATE_KEY }} | |
gpg_passphrase:${{ secrets.GPG_PASSPHRASE }} | |
nexus_username:${{ secrets.SONATYPE_USER }} | |
nexus_password:${{ secrets.SONATYPE_PASSWD }} | |
-name:Prepare libraries | |
run:| | |
mv -fv server/target/jdbcx-server-*-SNAPSHOT.jar \ | |
server/target/jdbcx-server-*-dependencies.tar.gz docker/app/. | |
-name:Set up QEMU | |
uses:docker/setup-qemu-action@v3 | |
-name:Set up Docker Buildx | |
uses:docker/setup-buildx-action@v3 | |
-name:Login to DockerHub | |
uses:docker/login-action@v3 | |
with: | |
username:${{ secrets.DOCKER_HUB_USER }} | |
password:${{ secrets.DOCKER_HUB_PASSWD }} | |
-name:Build and Push Docker Image | |
uses:docker/build-push-action@v6 | |
with: | |
context:. | |
file:./Dockerfile | |
platforms:linux/amd64,linux/arm64 | |
push:true | |
build-args:| | |
JDBCX_VERSION=${{ env.JDBCX_VERSION }}-SNAPSHOT | |
tags:| | |
jdbcx/jdbcx:${{ env.JDBCX_BRANCH }}-nightly | |
jdbcx/jdbcx:${{ env.JDBCX_VERSION }}-nightly |