17 Commits

Author SHA1 Message Date
1e8fdb52dd chore: fetch-depth 0 - all history for changelog
All checks were successful
Release / release (push) Successful in 55s
2025-07-06 15:17:28 +02:00
3d2cf37a17 chore: print debug msg
All checks were successful
Release / release (push) Successful in 55s
2025-07-06 15:06:41 +02:00
e2d08d7b70 chore: print body in workflow log
All checks were successful
Release / release (push) Successful in 55s
2025-07-06 15:01:41 +02:00
e8e6a24065 chore: release naming with defaults
All checks were successful
Release / release (push) Successful in 54s
2025-07-06 14:43:42 +02:00
ad8c2a6752 chore: release naming with defaults
Some checks failed
Release / release (push) Failing after 1m14s
2025-07-06 14:37:08 +02:00
c2c1e26a7c chore: release naming with defaults 2025-07-06 14:36:06 +02:00
5d8e533eff chore: simplify release naming in Gitea UI
All checks were successful
Release / release (push) Successful in 53s
2025-07-06 14:06:37 +02:00
432b705327 docs: guide in package javadoc; fix <
All checks were successful
Release / release (push) Successful in 1m24s
Signed-off-by: Leo Galambos <lg@hq.egothor.org>
2025-07-06 13:46:03 +02:00
4968cc516d fix: changelog without escape-on; javadoc was not published 2025-07-06 13:22:56 +02:00
02cd2acd6e chore: release tags with release@ prefix
All checks were successful
Release / release (push) Successful in 4m34s
2025-07-06 12:58:51 +02:00
90d4e063af gradle deps fixed
All checks were successful
Release / release (push) Successful in 52s
2025-07-05 23:18:12 +02:00
288fbfe0cc fix build without giteaToken defined
All checks were successful
Release / release (push) Successful in 3m42s
2025-07-05 23:06:07 +02:00
8172b1dbff giteaToken initialized in the release pipeline as a property
All checks were successful
Release / release (push) Successful in 10m58s
2025-07-05 21:46:57 +02:00
c079f2a843 giteaToken initialized in the release pipeline
Some checks failed
Release / release (push) Failing after 5m30s
2025-07-05 21:17:31 +02:00
7a97f94c39 fix gpg trust
Some checks failed
Release / release (push) Failing after 5m32s
2025-07-05 20:35:14 +02:00
ae90e43a72 fix /dev/tty deficit 2025-07-05 20:17:03 +02:00
6ebbbc80af Initial workflow setup 2025-07-05 01:30:20 +02:00
8 changed files with 220 additions and 41 deletions

View File

@@ -6,12 +6,6 @@
<attribute name="gradle_used_by_scope" value="main,test"/> <attribute name="gradle_used_by_scope" value="main,test"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="src" output="bin/main" path="src/main/resources">
<attributes>
<attribute name="gradle_scope" value="main"/>
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="bin/test" path="src/test/java"> <classpathentry kind="src" output="bin/test" path="src/test/java">
<attributes> <attributes>
<attribute name="gradle_scope" value="test"/> <attribute name="gradle_scope" value="test"/>
@@ -19,13 +13,6 @@
<attribute name="test" value="true"/> <attribute name="test" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="src" output="bin/test" path="src/test/resources">
<attributes>
<attribute name="gradle_scope" value="test"/>
<attribute name="gradle_used_by_scope" value="test"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21/"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21/"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/> <classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="output" path="bin/default"/> <classpathentry kind="output" path="bin/default"/>

View File

@@ -0,0 +1,89 @@
name: Release
on:
push:
tags:
- 'release@*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Java 21
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 21
- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Build and publish to Gitea Maven
run: ./gradlew clean publish --no-daemon -PgiteaToken=${{ secrets.CI_PUBLISH_TOKEN }}
- name: Upload built JAR
uses: actions/upload-artifact@v3
with:
name: conflux
path: build/libs/*.jar
- name: Generate release notes
id: notes
run: |
current_tag="${{ github.ref_name }}"
# strip the prefix for sorting, keep prefix for matching
prefix="release@"
# get all matching tags, strip prefix, sort them
all_versions=$(git tag --list "${prefix}*" | sed "s/^${prefix}//" | sort -V)
# find previous version
previous_tag=""
for v in $all_versions; do
if [[ "$prefix$v" == "$current_tag" ]]; then
break
fi
previous_tag="$prefix$v"
done
if [[ -z "$previous_tag" ]]; then
range=""
else
range="$previous_tag..$current_tag"
fi
echo "Comparing range: $range"
body="## What's New"
for category in "feat: Features" "fix: Bug Fixes" "docs: Documentation" "chore: Chores"; do
prefix="${category%%:*}"
title="${category##*: }"
entries=$(git log $range --pretty=format:"- %s" --grep="^$prefix" --no-merges)
# echo -e "Found:\n\n$entries\n\n"
if [[ -n "$entries" ]]; then
body="$body\n\n### $title\n$entries"
fi
done
echo -e "$body" > /tmp/release_notes.md
- name: Create Gitea Release
uses: softprops/action-gh-release@v2
with:
files: build/libs/*.jar
body_path: /tmp/release_notes.md

65
.gitea/workflows/tag.yml Normal file
View File

@@ -0,0 +1,65 @@
name: Tag version
on:
workflow_dispatch:
inputs:
bump:
description: "Which part to bump?"
required: true
default: "patch"
type: choice
options:
- major
- minor
- patch
jobs:
tag:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure git
run: |
echo "${{ secrets.CI_BOT_GPG_PRIVATE_KEY }}" | gpg --import --batch --yes
# set trust non-interactively
echo "${{ secrets.CI_BOT_GPG_FINGERPRINT }}:5:" | gpg --import-ownertrust
git config --global user.signingkey $GPG_KEY_ID
git config --global commit.gpgSign true
git config --global tag.gpgSign true
git config user.name "Gitea CI"
git config user.email "gitea-ci@hq.egothor.org"
git remote set-url origin https://ci-bot:${GITEA_PUSH_TOKEN}@gitea.egothor.org/Egothor/conflux.git
env:
GITEA_PUSH_TOKEN: ${{ secrets.CI_PUSH_TOKEN }}
GPG_KEY_ID: ${{ secrets.CI_BOT_GPG_KEY_ID }}
- name: Bump version and tag
run: |
latest=$(git tag --list 'conflux@*' | sed 's/conflux@//' | sort -V | tail -n 1)
if [[ -z "$latest" ]]; then
latest="0.0.0"
fi
echo "Latest: $latest"
IFS='.' read -r major minor patch <<<"$latest"
case "${{ github.event.inputs.bump }}" in
major)
major=$((major+1)); minor=0; patch=0 ;;
minor)
minor=$((minor+1)); patch=0 ;;
patch)
patch=$((patch+1)) ;;
*)
echo "Invalid bump type"
exit 1
;;
esac
next="$major.$minor.$patch"
new_tag="conflux@$next"
git tag -s $new_tag -m "Release $new_tag"
git push origin $new_tag
echo "Tagged $new_tag"

View File

@@ -6,7 +6,7 @@ plugins {
} }
group 'org.egothor' group 'org.egothor'
version gitVersion(prefix:'conflux@') version gitVersion(prefix:'release@')
repositories { repositories {
// Use Maven Central for resolving dependencies. // Use Maven Central for resolving dependencies.
@@ -25,6 +25,9 @@ java {
toolchain { toolchain {
languageVersion = JavaLanguageVersion.of(21) languageVersion = JavaLanguageVersion.of(21)
} }
withJavadocJar()
withSourcesJar()
} }
javadoc { javadoc {
@@ -36,27 +39,35 @@ tasks.named('test') {
useJUnitPlatform() useJUnitPlatform()
} }
publishing { tasks.withType(Javadoc).configureEach {
publications { options.bottom = "Copyright &copy; 2025 Egothor"
mavenJava(MavenPublication) { }
from components.java
}
}
repositories {
maven {
name = "GiteaMaven"
url = uri("https://gitea.egothor.org/api/packages/Egothor/maven")
credentials(HttpHeaderCredentials) { if (project.hasProperty('giteaToken') && project.giteaToken) {
name = "Authorization" publishing {
value = "token ${giteaToken}" publications {
mavenJava(MavenPublication) {
from components.java
} }
}
repositories {
maven {
name = "GiteaMaven"
url = uri("https://gitea.egothor.org/api/packages/Egothor/maven")
authentication { credentials(HttpHeaderCredentials) {
header(HttpHeaderAuthentication) name = "Authorization"
value = "token ${giteaToken}"
}
authentication {
header(HttpHeaderAuthentication)
}
} }
} }
} }
} else {
println "No giteaToken defined - skipping publishing configuration"
} }
gradle.taskGraph.whenReady { taskGraph -> gradle.taskGraph.whenReady { taskGraph ->

View File

@@ -1,12 +1,7 @@
# This file was generated by the Gradle 'init' task.
# https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format # https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format
[versions] [versions]
commons-math3 = "3.6.1"
guava = "33.1.0-jre"
junit-jupiter = "5.10.2" junit-jupiter = "5.10.2"
[libraries] [libraries]
commons-math3 = { module = "org.apache.commons:commons-math3", version.ref = "commons-math3" }
guava = { module = "com.google.guava:guava", version.ref = "guava" }
junit-jupiter = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit-jupiter" } junit-jupiter = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit-jupiter" }

View File

@@ -57,7 +57,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
* Usage: * Usage:
* *
* <pre> * <pre>
* Key<Integer> COUNT = Key.of("count", Integer.class); * Key&lt;Integer> COUNT = Key.of("count", Integer.class);
* Ctx.INSTANCE.put(COUNT, 42); * Ctx.INSTANCE.put(COUNT, 42);
* int v = Ctx.INSTANCE.get(COUNT); * int v = Ctx.INSTANCE.get(COUNT);
* </pre> * </pre>

View File

@@ -0,0 +1,32 @@
/**
* Provides a lightweight, type-safe, application-wide context mechanism for
* sharing strongly typed data among otherwise decoupled classes.
* <p>
* The {@link conflux.Ctx} class acts as a central, generic context storage
* supporting key-based put/get operations. Each {@link conflux.Key} defines a
* unique, strongly typed entry in the context, ensuring type consistency and
* preventing misuse. {@link conflux.Listener} interfaces allow clients to
* observe value changes for specific keys. Listeners are held with weak
* references to avoid memory leaks.
* <p>
* Typical usage involves defining {@link conflux.Key} instances with explicit
* types, storing values through {@code Ctx.INSTANCE.put()}, and retrieving them
* with {@code Ctx.INSTANCE.get()}. Listeners can be attached via
* {@code Ctx.INSTANCE.addListener()} to react to context changes in a decoupled
* and thread-safe manner. Values and listeners can be removed individually or
* the entire context can be cleared.
* <p>
* <b>Best Practices:</b>
* <ul>
* <li>Define keys as constants to maintain consistency and avoid
* collisions.</li>
* <li>Remove listeners when no longer needed (although weak references help
* prevent leaks).</li>
* <li>Use unique key names to ensure no accidental type conflicts.</li>
* </ul>
*
* @see conflux.Ctx
* @see conflux.Key
* @see conflux.Listener
*/
package conflux;