From d18fc02413994f0c05244d59d80814f5b4c8a1a3 Mon Sep 17 00:00:00 2001 From: Andreas Hufler Date: Fri, 9 Aug 2024 16:13:27 +0200 Subject: [PATCH 1/2] add ide config and update pipelines --- .github/workflows/main.yml | 53 ++++++---------------------- .github/workflows/maven-settings.xml | 33 +++++++++++++++++ .github/workflows/publish.yml | 43 ++++++++++++++++++++++ .github/workflows/test.yml | 25 +++++++++++++ .gitignore | 13 +++++-- .idea/.gitignore | 8 +++++ .idea/checkstyle-idea.xml | 26 ++++++++++++++ .idea/codeStyles/Project.xml | 23 ++++++++++++ .idea/codeStyles/codeStyleConfig.xml | 5 +++ .idea/encodings.xml | 7 ++++ .idea/misc.xml | 15 ++++++++ .idea/sqldialects.xml | 6 ++++ .idea/vcs.xml | 6 ++++ 13 files changed, 219 insertions(+), 44 deletions(-) create mode 100644 .github/workflows/maven-settings.xml create mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/test.yml create mode 100644 .idea/.gitignore create mode 100644 .idea/checkstyle-idea.xml create mode 100644 .idea/codeStyles/Project.xml create mode 100644 .idea/codeStyles/codeStyleConfig.xml create mode 100644 .idea/encodings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/sqldialects.xml create mode 100644 .idea/vcs.xml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 17aee10..d5eebb8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,45 +1,14 @@ -name: Publish package to GitHub Packages -on: - workflow_dispatch: - inputs: - version: - description: "Version name to publish (eg: x.x.x)" - type: string - required: true - -jobs: - publish: - timeout-minutes: 15 - runs-on: ubuntu-22.04 - permissions: - contents: read - packages: write - - steps: - - uses: actions/checkout@v3 +name: Test - - uses: aboutbits/github-actions-java/setup-and-install@v1 - with: - java-version: 21 - - - name: Set Version - run: sed -i 's|BUILD-SNAPSHOT|${{ github.event.inputs.version }}|g' pom.xml - - - name: Publish package - run: mvn --batch-mode deploy - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +on: + pull_request: + types: [ opened, reopened, synchronize ] - tag: - timeout-minutes: 5 - runs-on: ubuntu-22.04 - needs: publish - steps: - - uses: actions/checkout@v3 +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true - - name: Tag Deployment - uses: aboutbits/github-actions-base/git-create-or-update-tag@v1 - with: - tag-name: ${{ github.event.inputs.version }} - user-name: 'AboutBits' - user-email: 'info@aboutbits.it' +jobs: + test: + name: Tests + uses: ./.github/workflows/test.yml diff --git a/.github/workflows/maven-settings.xml b/.github/workflows/maven-settings.xml new file mode 100644 index 0000000..df833df --- /dev/null +++ b/.github/workflows/maven-settings.xml @@ -0,0 +1,33 @@ + + + + github + + + + + github + + + central + https://repo1.maven.org/maven2 + + + github + https://maven.pkg.github.com/aboutbits/* + + + + + + + + github + ${env.GITHUB_USER_NAME} + ${env.GITHUB_ACCESS_TOKEN} + + + diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..3ccc8f6 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,43 @@ +name: Publish package to GitHub Packages +on: + workflow_dispatch: + inputs: + version: + description: "Version name to publish (eg: x.x.x)" + type: string + required: true + +jobs: + publish: + timeout-minutes: 15 + runs-on: ubuntu-22.04 + permissions: + contents: read + packages: write + + steps: + - uses: actions/checkout@v4 + + - uses: aboutbits/github-actions-java/setup-and-install@v3 + + - name: Set Version + run: sed -i 's|BUILD-SNAPSHOT|${{ github.event.inputs.version }}|g' pom.xml + + - name: Publish package + run: mvn --batch-mode deploy + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + tag: + timeout-minutes: 5 + runs-on: ubuntu-22.04 + needs: publish + steps: + - uses: actions/checkout@v4 + + - name: Tag Deployment + uses: aboutbits/github-actions-base/git-create-or-update-tag@v1 + with: + tag-name: ${{ github.event.inputs.version }} + user-name: 'AboutBits' + user-email: 'info@aboutbits.it' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..72ed23d --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,25 @@ +name: Tests + +on: + workflow_call: + +jobs: + test: + name: Maven-Java + runs-on: ubuntu-22.04 + timeout-minutes: 10 + steps: + - uses: actions/checkout@v4 + - uses: aboutbits/github-actions-java/setup@v3 + with: + java-version: 21 + - run: >- + ./mvnw + -s $GITHUB_WORKSPACE/.github/workflows/maven-settings.xml + --batch-mode + --fail-fast + -Dsurefire.failIfNoSpecifiedTests=false + test + env: + GITHUB_USER_NAME: ${{ github.actor }} + GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 427ac49..26c6288 100644 --- a/.gitignore +++ b/.gitignore @@ -14,10 +14,19 @@ target/ .sts4-cache ### IntelliJ IDEA ### -.idea -*.iws +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 +.idea/* +!.idea/codeStyles +!.idea/.gitignore +!.idea/checkstyle-idea.xml +!.idea/encodings.xml +!.idea/misc.xml +!.idea/sqldialects.xml +!.idea/vcs.xml + *.iml *.ipr +*.iws ### NetBeans ### /nbproject/private/ diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml new file mode 100644 index 0000000..05f5e1f --- /dev/null +++ b/.idea/checkstyle-idea.xml @@ -0,0 +1,26 @@ + + + + 10.12.5 + JavaOnlyWithTests + + + + \ No newline at end of file diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..3baea1a --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,23 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..79ee123 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..aa00ffa --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..68a40a6 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,15 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/sqldialects.xml b/.idea/sqldialects.xml new file mode 100644 index 0000000..4606167 --- /dev/null +++ b/.idea/sqldialects.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file From f96ed841b680fd744b2a3d64ccd2c595467bdf2b Mon Sep 17 00:00:00 2001 From: Andreas Hufler Date: Fri, 9 Aug 2024 16:22:00 +0200 Subject: [PATCH 2/2] add local dev info to readme --- readme.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/readme.md b/readme.md index 5adf7b4..457f212 100644 --- a/readme.md +++ b/readme.md @@ -80,6 +80,14 @@ The following configuration options are available: | `lib.emailservice.scheduling.enabled` | true | Enables the scheduler sending the emails. | | `lib.emailservice.scheduling.interval` | 30000 | Specifies the milliseconds delay between runs of the scheduler. | +## Local development: + +To use this library as a local development dependency, you can simply refer to the version `BUILD-SNAPSHOT`. + +Check out this repository and run the maven goal `install`. This will build and install this library as version `BUILD-SNAPSHOT` into your local maven cache. + +Note that you may have to tell your IDE to reload your main maven project each time you build the library. + ## Building and releasing a new version: To create a new version of this package and push it to the maven registry, you will have to use the GitHub actions workflow and manually trigger it.