Compare commits
6 Commits
conflux@1.
...
conflux@1.
| Author | SHA1 | Date | |
|---|---|---|---|
|
288fbfe0cc
|
|||
|
8172b1dbff
|
|||
|
c079f2a843
|
|||
|
7a97f94c39
|
|||
|
ae90e43a72
|
|||
|
6ebbbc80af
|
46
.gitea/workflows/release.yml
Normal file
46
.gitea/workflows/release.yml
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'conflux@*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- 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: Create Gitea Release
|
||||||
|
uses: softprops/action-gh-release@v2
|
||||||
|
with:
|
||||||
|
files: build/libs/*.jar
|
||||||
|
tag_name: ${{ github.ref_name }}
|
||||||
|
name: Release ${{ github.ref_name }}
|
||||||
65
.gitea/workflows/tag.yml
Normal file
65
.gitea/workflows/tag.yml
Normal 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"
|
||||||
@@ -8,7 +8,7 @@ values and react to their changes in a clean and decoupled way.
|
|||||||
|
|
||||||
## Key Features
|
## Key Features
|
||||||
|
|
||||||
- Shared context for storing and retrieving named values
|
- Shared context for storing and retrieving named values
|
||||||
- Publish/subscribe event bus for listening to value changes
|
- Publish/subscribe event bus for listening to value changes
|
||||||
- Simple API for easy integration into existing projects
|
- Simple API for easy integration into existing projects
|
||||||
- Enables modular design by decoupling components through events
|
- Enables modular design by decoupling components through events
|
||||||
|
|||||||
36
build.gradle
36
build.gradle
@@ -36,27 +36,31 @@ tasks.named('test') {
|
|||||||
useJUnitPlatform()
|
useJUnitPlatform()
|
||||||
}
|
}
|
||||||
|
|
||||||
publishing {
|
if (project.hasProperty('giteaToken') && project.giteaToken) {
|
||||||
publications {
|
publishing {
|
||||||
mavenJava(MavenPublication) {
|
publications {
|
||||||
from components.java
|
mavenJava(MavenPublication) {
|
||||||
}
|
from components.java
|
||||||
}
|
|
||||||
repositories {
|
|
||||||
maven {
|
|
||||||
name = "GiteaMaven"
|
|
||||||
url = uri("https://gitea.egothor.org/api/packages/Egothor/maven")
|
|
||||||
|
|
||||||
credentials(HttpHeaderCredentials) {
|
|
||||||
name = "Authorization"
|
|
||||||
value = "token ${giteaToken}"
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
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 ->
|
||||||
|
|||||||
Reference in New Issue
Block a user