From 6bd1fdd530d1c53a10f8dbc628b24f9a6c052607 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Ho=C3=9F?= Date: Fri, 18 Nov 2022 17:07:39 +0100 Subject: [PATCH 1/3] enable lambda module deployments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sebastian Hoß --- memoization-lambda/pom.xml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/memoization-lambda/pom.xml b/memoization-lambda/pom.xml index 89e9fd3..9d8aae3 100755 --- a/memoization-lambda/pom.xml +++ b/memoization-lambda/pom.xml @@ -31,14 +31,6 @@ memoization.java :: lambda - - - - - - true - - From df7a7b99b195137eafc2f2ed29082a299480f17c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Ho=C3=9F?= Date: Thu, 14 Dec 2023 08:03:34 +0100 Subject: [PATCH 2/3] update workflows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sebastian Hoß --- .github/actions/managed-java/action.yml | 1 + .github/actions/managed-maven/action.yml | 1 + .github/dependabot.yml | 11 - .github/workflows/codeql-analysis.yml | 21 +- .github/workflows/release.yml | 49 ++-- .github/workflows/reuse.yml | 6 +- .github/workflows/update-parent.yml | 18 +- .github/workflows/verify.yml | 11 +- .idea/inspectionProfiles/memoization.java.xml | 233 +++++++++++++----- Makefile | 4 +- README.md | 17 +- maven-version-rules.xml | 15 -- 12 files changed, 218 insertions(+), 169 deletions(-) delete mode 100644 .github/dependabot.yml delete mode 100644 maven-version-rules.xml diff --git a/.github/actions/managed-java/action.yml b/.github/actions/managed-java/action.yml index a67bf08..0782375 100644 --- a/.github/actions/managed-java/action.yml +++ b/.github/actions/managed-java/action.yml @@ -13,3 +13,4 @@ runs: java-package: jdk architecture: x64 distribution: temurin + cache: maven diff --git a/.github/actions/managed-maven/action.yml b/.github/actions/managed-maven/action.yml index 308898c..be37e76 100644 --- a/.github/actions/managed-maven/action.yml +++ b/.github/actions/managed-maven/action.yml @@ -13,6 +13,7 @@ runs: java-package: jdk architecture: x64 distribution: temurin + cache: maven server-id: ossrh server-username: MAVEN_CENTRAL_USERNAME server-password: MAVEN_CENTRAL_TOKEN diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index b52cf01..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,11 +0,0 @@ -# SPDX-FileCopyrightText: The memoization.java Authors -# SPDX-License-Identifier: 0BSD - -version: 2 -updates: - - package-ecosystem: github-actions - directory: / - schedule: - interval: daily - assignees: - - sebhoss diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 5d065c0..adde946 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -19,26 +19,13 @@ jobs: language: [ java ] steps: - name: Checkout repository - uses: actions/checkout@v3 - - name: Set up Java - uses: actions/setup-java@v3 - with: - java-version: 17 - java-package: jdk - architecture: x64 - distribution: temurin - - name: Cache Maven Artifacts - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- + uses: actions/checkout@v4 + - uses: ./.github/actions/managed-java - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} - name: Autobuild uses: github/codeql-action/autobuild@v2 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 132a6f3..d8a6171 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,7 +4,7 @@ name: Automated Release on: schedule: - - cron: 45 3 * * TUE + - cron: 35 5 * * MON workflow_dispatch: jobs: publish: @@ -14,10 +14,17 @@ jobs: steps: - id: checkout name: Clone Git Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - id: last_release + name: Fetch last release info + run: echo "tag=$(gh release view --json tagName --jq '.tagName')" >> $GITHUB_OUTPUT + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - id: commits name: Count Commits - run: echo "count=$(git rev-list --count HEAD --since='last Tuesday')" >> $GITHUB_OUTPUT + run: echo "count=$(git rev-list --count ${{ steps.last_release.outputs.tag }}..HEAD -- pom.xml memoization-core/pom.xml memoization-core/src/main/java memoization-jdk/pom.xml memoization-jdk/src/main/java memoization-jool/pom.xml memoization-jool/src/main/java memoization-lambda/pom.xml memoization-lambda/src/main/java memoization-rxjava/pom.xml memoization-rxjava/src/main/java)" >> $GITHUB_OUTPUT - id: release name: Create Release Version if: steps.commits.outputs.count > 0 @@ -30,24 +37,16 @@ jobs: name: Build Timestamp if: steps.commits.outputs.count > 0 run: echo "iso8601=$(date --utc --iso-8601=seconds)" >> $GITHUB_OUTPUT - - uses: ./.github/actions/managed-maven + - id: setup-java + uses: ./.github/actions/managed-maven if: steps.commits.outputs.count > 0 - - id: cache - name: Cache Dependencies - if: steps.commits.outputs.count > 0 - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - id: gpg name: GPG Key if: steps.commits.outputs.count > 0 - uses: timheuer/base64-to-file@v1.2 + uses: timheuer/base64-to-file@v1 with: fileName: signing.key.asc - fileDir: ${{ github.workspace}} + fileDir: ${{ github.workspace }} encodedString: ${{ secrets.GPG_SECRET_KEY_BASE64 }} - id: pom-version name: Set Release Version @@ -56,15 +55,15 @@ jobs: - id: deploy-maven name: Deploy Maven Artifact if: steps.commits.outputs.count > 0 - run: | - mvn \ - --batch-mode \ - --activate-profiles release \ - --define scmTag=${{ steps.sha.outputs.sha }} \ - --define pgp.secretkey=keyfile:${{ steps.gpg.outputs.filePath }} \ - --define pgp.passphrase=literal:${{ secrets.GPG_SECRET_KEY_PASSWORD }} \ - --define project.build.outputTimestamp=${{ steps.timestamp.outputs.iso8601 }} \ - deploy + run: > + mvn + --batch-mode + --activate-profiles release + --define scmTag=${{ steps.sha.outputs.sha }} + --define pgp.secretkey=keyfile:${{ steps.gpg.outputs.filePath }} + --define pgp.passphrase=literal:${{ secrets.GPG_SECRET_KEY_PASSWORD }} + --define project.build.outputTimestamp=${{ steps.timestamp.outputs.iso8601 }} + deploy env: MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} @@ -83,7 +82,7 @@ jobs: - id: mail name: Send Mail if: steps.commits.outputs.count > 0 - uses: dawidd6/action-send-mail@v3.7.1 + uses: dawidd6/action-send-mail@v3 with: server_address: ${{ secrets.MAIL_SERVER }} server_port: ${{ secrets.MAIL_PORT }} diff --git a/.github/workflows/reuse.yml b/.github/workflows/reuse.yml index 67ded59..51039c3 100644 --- a/.github/workflows/reuse.yml +++ b/.github/workflows/reuse.yml @@ -3,14 +3,12 @@ name: REUSE compliance on: - push: - branches: [ main ] pull_request: branches: [ main ] jobs: reuse: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: REUSE Compliance Check - uses: fsfe/reuse-action@v1 + uses: fsfe/reuse-action@v2 diff --git a/.github/workflows/update-parent.yml b/.github/workflows/update-parent.yml index 47d2b4a..59a0785 100644 --- a/.github/workflows/update-parent.yml +++ b/.github/workflows/update-parent.yml @@ -10,19 +10,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Clone Git Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - uses: ./.github/actions/managed-java - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - name: Update Parent run: mvn --batch-mode --define generateBackupPoms=false versions:update-parent - id: cpr name: Create Pull Request - uses: peter-evans/create-pull-request@v4 + uses: peter-evans/create-pull-request@v5 with: token: ${{ secrets.PAT }} commit-message: Update parent to latest version @@ -41,8 +35,6 @@ jobs: delete-branch: true - name: Enable Pull Request Automerge if: steps.cpr.outputs.pull-request-operation == 'created' - uses: peter-evans/enable-pull-request-automerge@v2 - with: - token: ${{ secrets.PAT }} - pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} - merge-method: rebase + run: gh pr merge --rebase --auto ${{ steps.cpr.outputs.pull-request-number }} + env: + GH_TOKEN: ${{ secrets.PAT }} diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 1944b10..5648550 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -5,21 +5,12 @@ name: Verify Commits on: pull_request: branches: [ main ] - push: - branches: [ main ] jobs: verify: runs-on: ubuntu-latest steps: - name: Clone Git Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - uses: ./.github/actions/managed-java - - name: Cache Dependencies - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - name: Build with Maven run: mvn --batch-mode verify diff --git a/.idea/inspectionProfiles/memoization.java.xml b/.idea/inspectionProfiles/memoization.java.xml index bf9bbec..aa4c442 100644 --- a/.idea/inspectionProfiles/memoization.java.xml +++ b/.idea/inspectionProfiles/memoization.java.xml @@ -2,65 +2,178 @@ diff --git a/Makefile b/Makefile index b422dc9..56d0e77 100755 --- a/Makefile +++ b/Makefile @@ -9,10 +9,10 @@ MAKEFLAGS += --no-builtin-rules .ONESHELL: .DELETE_ON_ERROR: .DEFAULT_GOAL := help -ifneq ($(strip $(shell which zsh)),) +ifneq ($(strip $(shell command -v zsh 2> /dev/null)),) SHELL := zsh .SHELLFLAGS += -o pipefail -else ifneq ($(strip $(shell which bash)),) +else ifneq ($(strip $(shell command -v bash 2> /dev/null)),) SHELL := bash .SHELLFLAGS += -o pipefail else diff --git a/README.md b/README.md index 2dc0772..386a794 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Memoize any of the supported types by using the static factory methods supplied ```java wtf.metio.memoization.jdk.Memoize; wtf.metio.memoization.jool.MemoizeJool; -wtf.metio.memoization.jool.MemoizeLambda; +wtf.metio.memoization.lambda.MemoizeLambda; wtf.metio.memoization.rxjava.MemoizeRx; Function function = ...; @@ -51,7 +51,7 @@ Fn4 memoizedFunction = MemoizeLambda.fn4(function); ```java wtf.metio.memoization.jdk.Memoize; wtf.metio.memoization.jool.MemoizeJool; -wtf.metio.memoization.jool.MemoizeLambda; +wtf.metio.memoization.lambda.MemoizeLambda; wtf.metio.memoization.rxjava.MemoizeRx; Function function = ...; @@ -76,7 +76,7 @@ Fn4 memoizedFunction = MemoizeLambda.fn4(function, keyFu ```java wtf.metio.memoization.jdk.Memoize; wtf.metio.memoization.jool.MemoizeJool; -wtf.metio.memoization.jool.MemoizeLambda; +wtf.metio.memoization.lambda.MemoizeLambda; wtf.metio.memoization.rxjava.MemoizeRx; // memoize in cache2k cache @@ -105,7 +105,7 @@ Fn4 memoizedFunction = MemoizeLambda.fn4(function, cache ```java wtf.metio.memoization.jdk.Memoize; wtf.metio.memoization.jool.MemoizeJool; -wtf.metio.memoization.jool.MemoizeLambda; +wtf.metio.memoization.lambda.MemoizeLambda; wtf.metio.memoization.rxjava.MemoizeRx; // memoize in cache2k cache @@ -175,7 +175,7 @@ In order to use this project, declare the following dependencies in your project ``` -Replace `${version.memoization}` with the latest release. +Replace `${version.memoization}` with the [latest release](https://central.sonatype.com/namespace/wtf.metio.memoization). ## Alternatives @@ -208,10 +208,3 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ``` - -## Mirrors - -- https://github.com/metio/memoization.java -- https://gitlab.com/metio.wtf/memoization.java -- https://bitbucket.org/metio-wtf/memoization.java -- https://codeberg.org/metio.wtf/memoization.java \ No newline at end of file diff --git a/maven-version-rules.xml b/maven-version-rules.xml deleted file mode 100644 index f8f8da7..0000000 --- a/maven-version-rules.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - (?i).*alpha.* - (?i).*beta.* - (?i).*-b.* - (?i).*-rc.* - - From 7dbba2ccf626e3e20c9a37745ba5714a9050a30c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Ho=C3=9F?= Date: Thu, 14 Dec 2023 08:06:20 +0100 Subject: [PATCH 3/3] cannot release lambda yet b/c upstream has not released yet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sebastian Hoß --- memoization-lambda/pom.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/memoization-lambda/pom.xml b/memoization-lambda/pom.xml index 9d8aae3..89e9fd3 100755 --- a/memoization-lambda/pom.xml +++ b/memoization-lambda/pom.xml @@ -31,6 +31,14 @@ memoization.java :: lambda + + + + + + true + +