From a2f316d541ed66de136d5166b957e7b3578e1ea8 Mon Sep 17 00:00:00 2001 From: AB Date: Thu, 30 Sep 2021 08:26:51 +0200 Subject: [PATCH 1/4] Added dependabot and workflows --- .github/dependabot.yml | 22 ++++ .github/workflows/checkBuild.yml | 59 +++++++++ .github/workflows/release.yml | 202 ++++++++++++++++++++++++++++++ .github/workflows/test-deploy.yml | 28 +++++ 4 files changed, 311 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/checkBuild.yml create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/test-deploy.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..28d6d7b --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,22 @@ +version: 2 +updates: +- package-ecosystem: github-actions + directory: "/" + schedule: + interval: daily + # Run it at a specific time so that we don't get emails all day long + time: "00:00" + open-pull-requests-limit: 10 + ignore: + - dependency-name: "*" + # GitHub actions are using git tags (v1 = v1.2 = v1.2.3) which should be compatible until a major change is performed + update-types: + - "version-update:semver-minor" + - "version-update:semver-patch" +- package-ecosystem: maven + directory: "/" + schedule: + interval: daily + # Run it at a specific time so that we don't get emails all day long + time: "00:00" + open-pull-requests-limit: 10 diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml new file mode 100644 index 0000000..4a9923d --- /dev/null +++ b/.github/workflows/checkBuild.yml @@ -0,0 +1,59 @@ +name: Check Build + +on: + workflow_dispatch: + push: + branches: [ develop ] + paths-ignore: + - '**.md' + pull_request: + branches: [ develop ] + paths-ignore: + - '**.md' + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + java: [8, 11, 17] + java-package: [jdk] + distribution: [temurin] + + steps: + - uses: actions/checkout@v2 + + - name: Set up JDK + uses: actions/setup-java@v2 + with: + distribution: ${{ matrix.distribution }} + java-version: ${{ matrix.java }} + java-package: ${{ matrix.java-package }} + cache: 'maven' + + - name: Build with Maven + run: mvn -B clean verify + + - name: Check for uncommited changes + run: | + if [[ "$(git status --porcelain)" != "" ]]; then + echo ---------------------------------------- + echo git status + echo ---------------------------------------- + git status + echo ---------------------------------------- + echo git diff + echo ---------------------------------------- + git diff + echo ---------------------------------------- + echo Troubleshooting + echo ---------------------------------------- + echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && mvn -B clean verify" + exit 1 + fi + + - uses: actions/upload-artifact@v2 + with: + name: jars-java-${{ matrix.java }} + path: target/*.jar diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..6a4cb3e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,202 @@ +name: Release + +on: + push: + branches: [ master ] + +jobs: + check_code: # Validates the code (see develop.yml) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Set up JDK 8 + uses: actions/setup-java@v2 + with: + distribution: 'temurin' + java-version: '8' + cache: 'maven' + + - name: Build with Maven + run: mvn -B clean verify + + - name: Check for uncommited changes + run: | + if [[ "$(git status --porcelain)" != "" ]]; then + echo ---------------------------------------- + echo git status + echo ---------------------------------------- + git status + echo ---------------------------------------- + echo git diff + echo ---------------------------------------- + git diff + echo ---------------------------------------- + echo Troubleshooting + echo ---------------------------------------- + echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && mvn -B clean verify" + exit 1 + fi + + prepare_release: + runs-on: ubuntu-latest + needs: [check_code] + outputs: + upload_url: ${{ steps.create_draft.outputs.upload_url }} + steps: + - uses: actions/checkout@v2 + + - name: Configure Git + run: | + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + + - name: Un-SNAP + run: mvn -B versions:set -DremoveSnapshot -DgenerateBackupPoms=false + + - name: Get version + id: version + run: | + echo "::set-output name=release::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" + + - name: Commit and Push + run: | + git add -A + git commit -m "Release ${{ steps.version.outputs.release }}" + git push origin + git tag v${{ steps.version.outputs.release }} + git push origin --tags + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: v${{ steps.version.outputs.release }} + release_name: v${{ steps.version.outputs.release }} + commitish: master + body: | + ## Installation [![Maven Central](https://img.shields.io/maven-central/v/com.xdev-software/xapi-db-oracle-12c?versionPrefix=${{ steps.version.outputs.release }})](https://mvnrepository.com/artifact/com.xdev-software/xapi-db-oracle-12c) + Add the following lines to your pom: + ```XML + + com.xdev-software + xapi-db-oracle-12c + ${{ steps.version.outputs.release }} + + ``` + draft: false + prerelease: false + + publish_central: # Publish the code to central + runs-on: ubuntu-latest + needs: [prepare_release] + steps: + - uses: actions/checkout@v2 + + - name: Init Git and pull + run: | + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + git pull + + - name: Set up JDK 8 OSSRH + uses: actions/setup-java@v2 + with: # running setup-java again overwrites the settings.xml + distribution: 'temurin' + java-version: '8' + server-id: ossrh + server-username: MAVEN_CENTRAL_USERNAME + server-password: MAVEN_CENTRAL_TOKEN + gpg-passphrase: MAVEN_GPG_PASSPHRASE + gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + + - name: Publish to OSSRH + run: mvn -B deploy -Possrh + env: + MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} + MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} + + publish-pages: + name: Publish dependencies and licenses to github pages + runs-on: ubuntu-latest + needs: [prepare_release] + steps: + - uses: actions/checkout@v2 + + - name: Init Git and pull + run: | + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + git pull + + - name: Set up JDK 8 + uses: actions/setup-java@v2 + with: + distribution: 'temurin' + java-version: '8' + + - name: Build dependencies/licenses files + run: mvn -B project-info-reports:dependencies + + - name: Upload licenses - Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: dependencies-licenses + path: target/site + + - name: Generate docs/dependencies dir + run: mkdir -p docs/dependencies + + - name: Move built files into docs/dependencies + run: mv target/site/* docs/dependencies + + - name: Rename dependencies.html to index.html + working-directory: docs/dependencies + run: mv dependencies.html index.html + + - name: Copy Readme into docs (as index.md) + run: cp README.md docs/index.md + + - name: Configure Pages + working-directory: docs + run: |- + echo "theme: jekyll-theme-tactile" > _config.yml + + - name: Deploy to Github pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs + enable_jekyll: true + + after_release: + runs-on: ubuntu-latest + needs: [publish_central] + steps: + - uses: actions/checkout@v2 + + - name: Init Git and pull + run: | + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + git pull + + - name: Inc Version and SNAP root + run: mvn -B build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} -DgenerateBackupPoms=false -DnextSnapshot=true + + - name: Git Commit and Push + run: | + git add -A + git commit -m "Preparing for next development iteration" + git push origin + + - name: pull-request + uses: repo-sync/pull-request@v2 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + destination_branch: "develop" + pr_title: "Sync back" + pr_body: "An automated PR to sync changes back" diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml new file mode 100644 index 0000000..b8ca8c4 --- /dev/null +++ b/.github/workflows/test-deploy.yml @@ -0,0 +1,28 @@ +name: Test Deployment CI + +on: + workflow_dispatch: + +jobs: + publish_central: # Publish the code to central + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Set up JDK 8 OSSRH + uses: actions/setup-java@v2 + with: # running setup-java again overwrites the settings.xml + distribution: 'temurin' + java-version: '8' + server-id: ossrh + server-username: MAVEN_CENTRAL_USERNAME + server-password: MAVEN_CENTRAL_TOKEN + gpg-passphrase: MAVEN_GPG_PASSPHRASE + gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + + - name: Publish to OSSRH + run: mvn -B deploy -Possrh + env: + MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} + MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} From e5ad0151f14e697ecf7a85ceacede9f171201655 Mon Sep 17 00:00:00 2001 From: AB Date: Thu, 30 Sep 2021 08:28:13 +0200 Subject: [PATCH 2/4] Fixed pom --- pom.xml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/pom.xml b/pom.xml index ace9a3c..149f58a 100644 --- a/pom.xml +++ b/pom.xml @@ -39,14 +39,6 @@ - - - - GNU Lesser General Public License version 3 - https://www.gnu.org/licenses/lgpl-3.0.en.html - - - UTF-8 From 5828386d78b5095fab614f3496bb8eee6a41d1a8 Mon Sep 17 00:00:00 2001 From: AB Date: Thu, 30 Sep 2021 10:23:47 +0200 Subject: [PATCH 3/4] Found a matching JDBC driver --- README.md | 6 ------ pom.xml | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7c31cf6..6e20fdc 100644 --- a/README.md +++ b/README.md @@ -6,12 +6,6 @@ The XDEV Application Framework provides an abstraction over database dialects as part of its SqlEngine. This module is the Database Adapter for Oracle 12c which includes the Oracle-specific implementation for database access. -## IMPORTANT -*At the time of publishing this code, we couldn't find any maven dependency for a suitable JDBC adapter. -If you want to use this adapter properly, you have to search for a proper dependency or the correct ``.jar``.* - -We recommend downloading the official JDBC adapter from [Oracle directly](https://www.oracle.com/database/technologies/jdbc-drivers-12c-downloads.html). - ## XDEV-IDE XDEV(-IDE) is a visual Java development environment for fast and easy application development (RAD - Rapid Application Development). XDEV differs from other Java IDEs such as Eclipse or NetBeans, focusing on programming through a far-reaching RAD concept. The IDE's main components are a Swing GUI builder, the XDEV Application Framework, and numerous drag-and-drop tools and wizards with which the functions of the framework can be integrated. diff --git a/pom.xml b/pom.xml index 149f58a..86e8ae0 100644 --- a/pom.xml +++ b/pom.xml @@ -89,6 +89,12 @@ xapi 6.0.0 + + + com.oracle.database.jdbc + ojdbc8 + 12.2.0.1 + From 4818e40412d6de68f073e9d2f0b70f3a8393a72b Mon Sep 17 00:00:00 2001 From: Alex <45384811+AB-xdev@users.noreply.github.com> Date: Thu, 30 Sep 2021 10:29:05 +0200 Subject: [PATCH 4/4] Next version is 6.0.0 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 86e8ae0..15a68a3 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.xdev-software xapi-db-oracle-12c - 0.0.1-SNAPSHOT + 6.0.0-SNAPSHOT SqlEngine Database Adapter Oracle 12c XAPI SqlEngine Database Adapter for Oracle 12c @@ -300,4 +300,4 @@ - \ No newline at end of file +