fixes on db viewer - charts and reconnect #263
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: Build and Release | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - master | |
| tags: | |
| - 'hortonmachine-*' # any tag starting with v, e.g. v0.10.11 | |
| permissions: | |
| contents: write | |
| jobs: | |
| # ---- SNAPSHOT BUILD ---- | |
| snapshot: | |
| if: github.ref_type == 'branch' && github.ref == 'refs/heads/master' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| cache: 'maven' | |
| server-id: ossrh | |
| server-username: MAVEN_USERNAME | |
| server-password: MAVEN_PASSWORD | |
| gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | |
| gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
| - name: Run Tests | |
| run: mvn -U clean verify | |
| - name: Build and Deploy Snapshot | |
| run: mvn -U deploy -DskipTests=true -P release -Dmaven.javadoc.skip=true -Dgpg.skip=false | |
| env: | |
| MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} | |
| MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
| MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
| # ---- RELEASE BUNDLE ---- | |
| release-bundle: | |
| if: startsWith(github.ref, 'refs/tags/') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| cache: 'maven' | |
| - name: Resolve project version | |
| id: ver | |
| run: echo "VERSION=$(mvn -q -DforceStdout help:evaluate -Dexpression=project.version)" >> "$GITHUB_OUTPUT" | |
| #- name: Build project (skip tests + javadoc) | |
| # run: mvn -U clean install -DskipTests -Dmaven.javadoc.skip=true | |
| - name: Build bundle with embedded JRE | |
| run: | | |
| set -euxo pipefail | |
| VERSION=$(mvn -q -DforceStdout help:evaluate -Dexpression=project.version) | |
| TMPLIBS=./extras/export/libs | |
| DEPLOY=./extras/deploy | |
| RELEASE_DIR=${DEPLOY}/hortonmachine_${VERSION} | |
| rm -rf "${TMPLIBS}" "${DEPLOY}/libs" "${DEPLOY}"/*.tar.gz "${RELEASE_DIR}" | |
| mkdir -p "${RELEASE_DIR}" | |
| # Build and populate ./extras/export/libs | |
| mvn -U clean | |
| mvn -U install -Dmaven.test.skip=true -Dmaven.javadoc.skip=true | |
| # Fail fast if libs weren't created by the build | |
| test -d "${TMPLIBS}" | |
| # remove unused | |
| rm -f "${TMPLIBS}"/junit*.jar || true | |
| rm -f "${TMPLIBS}"/log4j-*.jar || true | |
| # Copy the app jar itself into libs | |
| cp ./apps/target/hm-apps-*.jar "${TMPLIBS}" | |
| rm -f "${TMPLIBS}"/*-sources.jar || true | |
| # Put libs into release dir | |
| mv "${TMPLIBS}" "${RELEASE_DIR}/libs" | |
| # Copy deploy assets (allow missing patterns) | |
| shopt -s nullglob | |
| cp -rv ${DEPLOY}/*.sh ${DEPLOY}/*.exe ${DEPLOY}/*.bat "${RELEASE_DIR}" || true | |
| cp -rv ${DEPLOY}/imgs ${DEPLOY}/natives ${DEPLOY}/quiet-logging.properties "${RELEASE_DIR}" || true | |
| shopt -u nullglob | |
| # ---- Embed Windows JRE ---- | |
| JRE_URL="https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.16%2B8/OpenJDK17U-jre_x64_windows_hotspot_17.0.16_8.zip" | |
| echo "Downloading Temurin JRE from: ${JRE_URL}" | |
| curl -fsSL -o ./temurin-jre-win.zip "${JRE_URL}" | |
| unzip -q ./temurin-jre-win.zip -d . | |
| mv jdk-17.0.16+8-jre "${RELEASE_DIR}/jre" | |
| rm -f ./temurin-jre-win.zip | |
| # Tarball | |
| tar -C "${DEPLOY}" -zcvf "${DEPLOY}/hortonmachine_${VERSION}.tar.gz" "hortonmachine_${VERSION}" | |
| # keep libs next to tarball | |
| mv "${RELEASE_DIR}/libs" "${DEPLOY}/" || true | |
| rm -rf "${RELEASE_DIR}" | |
| - name: Build release title | |
| id: rel | |
| run: | | |
| VERSION=$(mvn -q -DforceStdout help:evaluate -Dexpression=project.version) | |
| DATE=$(date +'%Y-%m-%d %H%M') | |
| echo "TITLE=Hortonmachine-${VERSION} - release ${DATE}" >> $GITHUB_OUTPUT | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.ref_name }} # the tag that triggered the workflow | |
| name: ${{ steps.rel.outputs.TITLE }} | |
| body: | | |
| SNAPSHOT Release ${{ steps.ver.outputs.VERSION }} of the hortonmachine libs, | |
| run-ready for Windows users (Java + SpatiaLite libs). | |
| Linux and macOS users will know what to do. | |
| files: extras/deploy/hortonmachine_${{ steps.ver.outputs.VERSION }}.tar.gz | |
| - name: Attach bundle to GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: extras/deploy/hortonmachine_${{ steps.ver.outputs.VERSION }}.tar.gz | |