diff --git a/.github/actions/managed-java/action.yml b/.github/actions/managed-java/action.yml
index 7b1a0bd..4ff3406 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 b70cecb..703ce0d 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 f015a93..0000000
--- a/.github/dependabot.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-# SPDX-FileCopyrightText: The Storage-Units 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 b4e067d..2081466 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -18,23 +18,9 @@ jobs:
matrix:
language: [ java ]
steps:
- - id: checkout
- name: Checkout
+ - name: Checkout repository
uses: actions/checkout@v4
- - name: Set up Java
- uses: actions/setup-java@v4
- 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: ./.github/actions/managed-java
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
diff --git a/.github/workflows/dependabot-automerge.yml b/.github/workflows/dependabot-automerge.yml
deleted file mode 100644
index e762996..0000000
--- a/.github/workflows/dependabot-automerge.yml
+++ /dev/null
@@ -1,20 +0,0 @@
-# SPDX-FileCopyrightText: The Storage-Units Authors
-# SPDX-License-Identifier: 0BSD
-
-name: Dependabot auto-merge
-on: pull_request
-
-permissions:
- contents: write
- pull-requests: write
-
-jobs:
- dependabot:
- runs-on: ubuntu-latest
- if: ${{ github.actor == 'dependabot[bot]' }}
- steps:
- - name: Enable auto-merge for Dependabot PRs
- run: gh pr merge --auto --rebase "$PR_URL"
- env:
- PR_URL: ${{ github.event.pull_request.html_url }}
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 6d27a84..5910fd1 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -4,7 +4,7 @@
name: Automated Release
on:
schedule:
- - cron: 27 4 * * TUE
+ - cron: 35 3 * * WED
workflow_dispatch:
jobs:
publish:
@@ -13,7 +13,7 @@ jobs:
contents: write
steps:
- id: checkout
- name: Checkout
+ name: Clone Git Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
@@ -24,7 +24,7 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- id: commits
name: Count Commits
- run: echo "count=$(git rev-list --count ${{ steps.last_release.outputs.tag }}..HEAD)" >> $GITHUB_OUTPUT
+ run: echo "count=$(git rev-list --count ${{ steps.last_release.outputs.tag }}..HEAD -- pom.xml storage-units-dozer storage-units-eclipselink storage-units-gson storage-units-jackson storage-units-jakarta storage-units-mapstruct storage-units-model storage-units-modelmapper storage-units-mongodb storage-units-orika storage-units-simple)" >> $GITHUB_OUTPUT
- id: release
name: Create Release Version
if: steps.commits.outputs.count > 0
@@ -38,33 +38,15 @@ jobs:
if: steps.commits.outputs.count > 0
run: echo "iso8601=$(date --utc --iso-8601=seconds)" >> $GITHUB_OUTPUT
- id: setup-java
- name: Set up Java
+ uses: ./.github/actions/managed-maven
if: steps.commits.outputs.count > 0
- uses: actions/setup-java@v4
- with:
- java-version: 17
- java-package: jdk
- architecture: x64
- distribution: temurin
- server-id: ossrh
- server-username: MAVEN_CENTRAL_USERNAME
- server-password: MAVEN_CENTRAL_TOKEN
- - 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
@@ -108,7 +90,7 @@ jobs:
password: ${{ secrets.MAIL_PASSWORD }}
subject: ${{ github.event.repository.name }} version ${{ steps.release.outputs.version }} published
body: See ${{ steps.create_release.outputs.url }} for details.
- to: announcements@metio.groups.io
+ to: ${{ secrets.MAIL_RECIPIENT }}
from: ${{ secrets.MAIL_SENDER }}
- id: matrix
name: Send Matrix Message
@@ -118,4 +100,4 @@ jobs:
room_id: ${{ secrets.MATRIX_ROOM_ID }}
access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
message: ${{ github.event.repository.name }} version [${{ steps.release.outputs.version }}](${{ steps.create_release.outputs.url }}) published
- server: matrix.org
+ server: ${{ secrets.MATRIX_SERVER }}
diff --git a/.github/workflows/reuse.yml b/.github/workflows/reuse.yml
index 31a8c32..1badef4 100644
--- a/.github/workflows/reuse.yml
+++ b/.github/workflows/reuse.yml
@@ -3,16 +3,12 @@
name: REUSE compliance
on:
- push:
- branches: [ main ]
pull_request:
branches: [ main ]
jobs:
reuse:
runs-on: ubuntu-latest
steps:
- - id: checkout
- name: Checkout
- uses: actions/checkout@v4
+ - uses: actions/checkout@v4
- name: REUSE Compliance Check
uses: fsfe/reuse-action@v2
diff --git a/.github/workflows/update-parent.yml b/.github/workflows/update-parent.yml
index 8a7cab7..4c232c3 100644
--- a/.github/workflows/update-parent.yml
+++ b/.github/workflows/update-parent.yml
@@ -12,12 +12,6 @@ jobs:
- name: Clone Git Repository
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
@@ -31,14 +25,16 @@ jobs:
title: Update parent to latest version
body: |
`mvn --batch-mode --define generateBackupPoms=false versions:update-parent`
- assignees: sebhoss
+ labels: |
+ enhancement
+ assignees: |
+ sebhoss
draft: false
base: main
branch: update-parent
delete-branch: true
- - id: automerge
- name: Enable Pull Request Automerge
+ - name: Enable Pull Request Automerge
if: steps.cpr.outputs.pull-request-operation == 'created'
- run: gh pr merge --rebase --auto "${{ steps.cpr.outputs.pull-request-number }}"
+ 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 0c2c4a8..6833724 100644
--- a/.github/workflows/verify.yml
+++ b/.github/workflows/verify.yml
@@ -3,39 +3,14 @@
name: Verify Commits
on:
- push:
- branches: [ main ]
pull_request:
branches: [ main ]
-env:
- JAVA_VERSION: 17
- JAVA_PACKAGE: jdk
- JAVA_ARCH: x64
- JAVA_DISTRO: temurin
jobs:
- build:
- name: Build Project
+ verify:
runs-on: ubuntu-latest
steps:
- - id: checkout
- name: Checkout
+ - name: Clone Git Repository
uses: actions/checkout@v4
- - id: java
- name: Setup Java
- uses: actions/setup-java@v4
- with:
- java-version: ${{ env.JAVA_VERSION }}
- java-package: ${{ env.JAVA_PACKAGE }}
- architecture: ${{ env.JAVA_ARCH }}
- distribution: ${{ env.JAVA_DISTRO }}
- - id: cache
- name: Cache Maven Repository
- uses: actions/cache@v3
- with:
- path: ~/.m2/repository
- key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
- restore-keys: |
- ${{ runner.os }}-maven-
- - id: maven
- name: Maven Verify
+ - uses: ./.github/actions/managed-java
+ - name: Build with Maven
run: mvn --batch-mode verify
diff --git a/.idea/inspectionProfiles/storage-units.java.xml b/.idea/inspectionProfiles/storage-units.java.xml
index 169bf0c..f5f3922 100644
--- a/.idea/inspectionProfiles/storage-units.java.xml
+++ b/.idea/inspectionProfiles/storage-units.java.xml
@@ -2,178 +2,178 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/Makefile b/Makefile
index 1ff8107..110ba79 100644
--- 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 277b21c..733f6b6 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@ SPDX-FileCopyrightText: The Storage-Units Authors
SPDX-License-Identifier: 0BSD
-->
-# Storage-Units
+# Storage-Units [![Chat](https://img.shields.io/badge/matrix-%23talk.metio:matrix.org-brightgreen.svg?style=social&label=Matrix)](https://matrix.to/#/#talk.metio:matrix.org)
Storage units according to ISO IEC 80000-13:2008 implemented in Java.
@@ -466,7 +466,7 @@ To use this project just declare the following dependency inside your POM:
```
-Replace `${version.storage-units}` with the [latest release](https://search.maven.org/search?q=g:wtf.metio.storage-units).
+Replace `${version.storage-units}` with the [latest release](https://central.sonatype.com/namespace/wtf.metio.storage-units).
## Reference
@@ -476,25 +476,3 @@ Originally inspired by [Twitters util](https://github.com/twitter/util#space) pa
* [Byte Units](https://github.com/JakeWharton/byteunits)
* [triava](https://github.com/trivago/triava)
-
-## License
-
-```
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
-REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
-INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-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/storage-units.java
-- https://gitlab.com/metio.wtf/storage-units.java
-- https://bitbucket.org/metio-wtf/storage-units.java
-- https://codeberg.org/metio.wtf/storage-units.java
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index e3de463..01e4eb3 100755
--- a/pom.xml
+++ b/pom.xml
@@ -32,7 +32,7 @@
Storage Units
Implementation of storage units according to ISO IEC 80000-13:2008.
- https://storage-units.projects.metio.wtf/
+ https://github.com/metio/storage-units.java
2012