Skip to content

Commit b6234db

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents a1ba156 + 2729183 commit b6234db

File tree

3 files changed

+78
-2
lines changed

3 files changed

+78
-2
lines changed

.github/workflows/gradle-publish.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,4 @@ jobs:
4141
- name: Publish to GitHub Packages
4242
run: gradle publish
4343
env:
44-
GITHUB_ACTOR: ${{ github.actor }}
45-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
REPOSILITE_TOKEN: ${{secrets.REPOSILITE_TOKEN}}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Update README with Latest Version
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
update-readme:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout Repository
13+
uses: actions/checkout@v4
14+
15+
- name: Get Latest Release Version
16+
id: get_latest_release
17+
uses: actions/github-script@v7
18+
with:
19+
script: |
20+
const latestRelease = await github.rest.repos.getLatestRelease({
21+
owner: context.repo.owner,
22+
repo: context.repo.repo,
23+
});
24+
return { version: latestRelease.data.tag_name.replace(/^v/, '') };
25+
26+
- name: Update README.md
27+
id: update_readme
28+
run: |
29+
LATEST_VERSION=${{ steps.get_latest_release.outputs.version }}
30+
# Replace the version string in the Gradle dependency line
31+
sed -i "s/de\.derioo:javautils:[0-9]*\.[0-9]*\.[0-9]*/de.derioo:javautils:${LATEST_VERSION}/g" README.md
32+
# Replace the version string in the Maven dependency line
33+
sed -i "s/<version>[0-9]*\.[0-9]*\.[0-9]*<\/version>/<version>${LATEST_VERSION}<\/version>/g" README.md
34+
35+
- name: Commit Changes
36+
run: |
37+
git config --global user.name 'github-actions[bot]'
38+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
39+
git add README.md
40+
git commit -m "Update README with latest version ${{ steps.get_latest_release.outputs.version }}"
41+
git push
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Releases will be published here:
2+
3+
Repository (gradle):
4+
```
5+
repositories {
6+
maven("https://nexus.derioo.de/releases")
7+
}
8+
```
9+
Repository (maven):
10+
```
11+
<repositories>
12+
<repository>
13+
<id>derio-releases</id>
14+
<name>Derios Repository</name>
15+
<url>https://nexus.derioo.de/releases</url>
16+
</repository>
17+
</repositories>
18+
```
19+
Dependency (gradle):
20+
```
21+
dependencies {
22+
implementation("de.derioo:javautils:1.2.0")
23+
}
24+
```
25+
Dependency (maven):
26+
```
27+
<dependencies>
28+
<dependency>
29+
<groupId>de.derioo</groupId>
30+
<artifactId>javautils</artifactId>
31+
<version>1.2.0</version>
32+
</dependency>
33+
</dependencies>
34+
```

0 commit comments

Comments
 (0)