Skip to content

Commit 570f4c8

Browse files
authored
Update/upgrade to xemantic conventions plugin (#7)
* github actions updated * release process updated to jreleaser
1 parent 280cc95 commit 570f4c8

File tree

10 files changed

+226
-304
lines changed

10 files changed

+226
-304
lines changed

.github/scripts/update-readme-version.sh

Lines changed: 0 additions & 74 deletions
This file was deleted.

.github/workflows/build-branch.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
# Builds every branch other than main, so that any change pushed to GitHub in a feature branch can be built and tested
12
name: Build branch
3+
24
on:
35
push:
46
branches-ignore:
@@ -11,17 +13,17 @@ jobs:
1113
build_branch:
1214
runs-on: ubuntu-latest
1315
steps:
14-
- name: Checkout sources
15-
uses: actions/checkout@v4.2.2
16+
- name: Checkout sources
17+
uses: actions/checkout@v4.2.2
1618

17-
- name: Setup Java
18-
uses: actions/setup-java@v4.6.0
19-
with:
20-
distribution: 'temurin'
21-
java-version: 23
19+
- name: Setup Java
20+
uses: actions/setup-java@v4.6.0
21+
with:
22+
distribution: 'temurin'
23+
java-version: 23
2224

23-
- name: Setup Gradle
24-
uses: gradle/actions/setup-gradle@v4.2.2
25+
- name: Setup Gradle
26+
uses: gradle/actions/setup-gradle@v4.2.2
2527

26-
- name: Build
27-
run: ./gradlew build
28+
- name: Build
29+
run: ./gradlew build

.github/workflows/build-main.yml

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,31 @@
1+
# Builds than main branch, and then deploys SNAPSHOT versions to GitHub Packages
12
name: Build main
3+
24
on:
35
push:
46
branches:
57
- main
8+
69
jobs:
710
build_main:
811
runs-on: ubuntu-latest
912
steps:
10-
- name: Checkout sources
11-
uses: actions/checkout@v4.2.2
13+
- name: Checkout sources
14+
uses: actions/checkout@v4.2.2
1215

13-
- name: Setup Java
14-
uses: actions/setup-java@v4.6.0
15-
with:
16-
distribution: 'temurin'
17-
java-version: 23
16+
- name: Setup Java
17+
uses: actions/setup-java@v4.6.0
18+
with:
19+
distribution: 'temurin'
20+
java-version: 23
1821

19-
- name: Setup Gradle
20-
uses: gradle/actions/setup-gradle@v4.2.2
22+
- name: Setup Gradle
23+
uses: gradle/actions/setup-gradle@v4.2.2
2124

22-
- name: Build
23-
run: ./gradlew build sourcesJar dokkaGeneratePublicationHtml publish
24-
env:
25-
ORG_GRADLE_PROJECT_githubActor: ${{ secrets.GITHUBACTOR }}
26-
ORG_GRADLE_PROJECT_githubToken: ${{ secrets.GITHUBTOKEN }}
25+
- name: Build
26+
run: ./gradlew build sourcesJar javadocJar publish
27+
env:
28+
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
29+
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
30+
ORG_GRADLE_PROJECT_githubActor: ${{ secrets.GITHUBACTOR }}
31+
ORG_GRADLE_PROJECT_githubToken: ${{ secrets.GITHUBTOKEN }}

.github/workflows/build-release.yml

Lines changed: 70 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
# Builds the release
12
name: Build release
3+
24
on:
35
release:
4-
types: [published]
6+
types: [ published ]
7+
58
jobs:
69
build_release:
710
runs-on: ubuntu-latest
@@ -10,48 +13,69 @@ jobs:
1013
# added or changed files to the repository.
1114
contents: write
1215
steps:
13-
- name: Write release version
14-
run: |
15-
VERSION=${GITHUB_REF_NAME#v}
16-
echo Version: $VERSION
17-
echo "VERSION=$VERSION" >> $GITHUB_ENV
18-
19-
- name: Checkout sources
20-
uses: actions/checkout@v4.2.2
21-
with:
22-
ref: ${{ github.head_ref }}
23-
fetch-depth: 0
24-
25-
- name: Setup Java
26-
uses: actions/setup-java@v4.6.0
27-
with:
28-
distribution: 'temurin'
29-
java-version: 23
30-
31-
- name: Setup Gradle
32-
uses: gradle/actions/setup-gradle@v4.2.2
33-
34-
- name: Build
35-
env:
36-
ORG_GRADLE_PROJECT_githubActor: ${{ secrets.GITHUBACTOR }}
37-
ORG_GRADLE_PROJECT_githubToken: ${{ secrets.GITHUBTOKEN }}
38-
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
39-
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
40-
ORG_GRADLE_PROJECT_sonatypeUser: ${{ secrets.SONATYPE_USER }}
41-
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
42-
run: ./gradlew -Pversion=$VERSION build sourcesJar dokkaGeneratePublicationHtml publishToSonatype closeAndReleaseSonatypeStagingRepository
43-
44-
- name: Checkout main branch
45-
uses: actions/checkout@v4.2.2
46-
with:
47-
ref: main
48-
fetch-depth: 0
49-
50-
- name: Update README
51-
run: sh .github/scripts/update-readme-version.sh
52-
53-
- name: Commit README
54-
uses: stefanzweifel/git-auto-commit-action@v5.1.0
55-
with:
56-
commit_message: Dependency version in README.md updated to ${{ env.VERSION }}
57-
file_pattern: 'README.md'
16+
- name: Write release version
17+
run: |
18+
VERSION=${GITHUB_REF_NAME#v}
19+
echo Version: $VERSION
20+
echo "VERSION=$VERSION" >> $GITHUB_ENV
21+
22+
- name: Checkout sources
23+
uses: actions/checkout@v4.2.2
24+
25+
- name: Setup Java
26+
uses: actions/setup-java@v4.6.0
27+
with:
28+
distribution: 'temurin'
29+
java-version: 23
30+
31+
- name: Setup Gradle
32+
uses: gradle/actions/setup-gradle@v4.2.2
33+
34+
- name: Build
35+
env:
36+
ORG_GRADLE_PROJECT_githubActor: ${{ secrets.GITHUBACTOR }}
37+
ORG_GRADLE_PROJECT_githubToken: ${{ secrets.GITHUBTOKEN }}
38+
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
39+
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
40+
JRELEASER_DEPLOY_MAVEN_MAVENCENTRAL_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
41+
JRELEASER_DEPLOY_MAVEN_MAVENCENTRAL_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
42+
JRELEASER_DISCORD_WEBHOOK: ${{ secrets.DISCORD_ANNOUCEMENTS_WEBHOOK }}
43+
JRELEASER_LINKEDIN_ACCESS_TOKEN: ${{ secrets.LINKEDIN_ACCESS_TOKEN }}
44+
# in the future, once https://github.com/jreleaser/jreleaser/issues/1796 is fix, it should be xemantic page on LinkedIn, right now the owner is taken from the profile
45+
# JRELEASER_LINKEDIN_OWNER: ${{ secrets.LINKEDIN_OWNER }}
46+
JRELEASER_BLUESKY_HOST: ${{ vars.BLUESKY_HOST }}
47+
JRELEASER_BLUESKY_HANDLE: ${{ vars.BLUESKY_HANDLE }}
48+
JRELEASER_BLUESKY_PASSWORD: ${{ secrets.BLUESKY_PASSWORD }}
49+
50+
run: ./gradlew -Pversion=$VERSION build sourcesJar javadocJar publish jreleaserFullRelease
51+
52+
- name: Display JReleaser trace.log
53+
run: |
54+
if [ -f build/jreleaser/trace.log ]; then
55+
echo "trace.log Content:"
56+
cat build/jreleaser/trace.log
57+
else
58+
echo "trace.log file not found"
59+
fi
60+
61+
- name: Get target branch for tag
62+
run: |
63+
git fetch --all
64+
TARGET_BRANCH=$(git branch -r --contains $GITHUB_REF | grep -v "HEAD" | head -n 1 | sed 's/origin\///')
65+
echo "Target branch for tag: $TARGET_BRANCH"
66+
echo "TARGET_BRANCH=$TARGET_BRANCH" >> $GITHUB_ENV
67+
68+
- name: Checkout target branch
69+
uses: actions/checkout@v4.2.2
70+
with:
71+
ref: ${{ env.TARGET_BRANCH }}
72+
fetch-depth: 0
73+
74+
- name: Update README
75+
run: ./gradlew -Pversion=$VERSION updateVersionInReadme
76+
77+
- name: Commit README.md pointing to released version
78+
uses: stefanzweifel/git-auto-commit-action@v5.1.0
79+
with:
80+
commit_message: Dependency version in README.md updated to ${{ env.VERSION }}
81+
file_pattern: 'README.md'

.github/workflows/updater.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name: GitHub Actions Version Updater
44
on:
55
schedule:
66
# Automatically run on every Sunday
7-
- cron: '0 0 * * 0'
7+
- cron: '0 0 * * 0'
88

99
jobs:
1010
build:

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# xemantic-ai-file-magic
2-
Detecting file content type before submitting binary content to LLM, a small Kotlin multiplatform library.
2+
Detecting file media type before submitting binary content to LLM, a small Kotlin multiplatform library.
33

4-
[<img alt="Maven Central Version" src="https://img.shields.io/maven-central/v/com.xemantic.ai/xemantic-ai-file-magic">](https://central.sonatype.com/namespace/com.xemantic.ai)
4+
[<img alt="Maven Central Version" src="https://img.shields.io/maven-central/v/com.xemantic.ai/xemantic-ai-file-magic">](https://central.sonatype.com/artifact/com.xemantic.ai/xemantic-ai-file-magic)
55
[<img alt="GitHub Release Date" src="https://img.shields.io/github/release-date/xemantic/xemantic-ai-file-magic">](https://github.com/xemantic/xemantic-ai-file-magic/releases)
66
[<img alt="license" src="https://img.shields.io/github/license/xemantic/xemantic-ai-file-magic?color=blue">](https://github.com/xemantic/xemantic-ai-file-magic/blob/main/LICENSE)
77

@@ -13,12 +13,10 @@ Detecting file content type before submitting binary content to LLM, a small Kot
1313
[<img alt="GitHub contributors" src="https://img.shields.io/github/contributors/xemantic/xemantic-ai-file-magic">](https://github.com/xemantic/xemantic-ai-file-magic/graphs/contributors)
1414
[<img alt="GitHub commit activity" src="https://img.shields.io/github/commit-activity/t/xemantic/xemantic-ai-file-magic">](https://github.com/xemantic/xemantic-ai-file-magic/commits/main/)
1515
[<img alt="GitHub code size in bytes" src="https://img.shields.io/github/languages/code-size/xemantic/xemantic-ai-file-magic">]()
16-
[<img alt="GitHub Created At" src="https://img.shields.io/github/created-at/xemantic/xemantic-ai-file-magic">](https://github.com/xemantic/xemantic-ai-file-magic/commit/39c1fa4c138d4c671868c973e2ad37b262ae03c2)
16+
[<img alt="GitHub Created At" src="https://img.shields.io/github/created-at/xemantic/xemantic-ai-file-magic">](https://github.com/xemantic/xemantic-ai-file-magic/commits)
1717
[<img alt="kotlin version" src="https://img.shields.io/badge/dynamic/toml?url=https%3A%2F%2Fraw.githubusercontent.com%2Fxemantic%2Fxemantic-ai-file-magic%2Fmain%2Fgradle%2Flibs.versions.toml&query=versions.kotlin&label=kotlin">](https://kotlinlang.org/docs/releases.html)
18-
19-
[<img alt="discord server" src="https://dcbadge.limes.pink/api/server/https://discord.gg/vQktqqN2Vn?style=flat">](https://discord.gg/vQktqqN2Vn)
2018
[<img alt="discord users online" src="https://img.shields.io/discord/811561179280965673">](https://discord.gg/vQktqqN2Vn)
21-
[<img alt="X (formerly Twitter) Follow" src="https://img.shields.io/twitter/follow/KazikPogoda">](https://x.com/KazikPogoda)
19+
[![Bluesky](https://img.shields.io/badge/Bluesky-0285FF?logo=bluesky&logoColor=fff)](https://bsky.app/profile/xemantic.com)
2220

2321
## Why?
2422

0 commit comments

Comments
 (0)