Skip to content

Commit b635341

Browse files
better workflow
1 parent 327fa8d commit b635341

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

.github/workflows/release.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # Only run on version tags like v1.0.0
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
fetch-tags: true
17+
18+
- name: Setup JDK 17
19+
uses: actions/setup-java@v4
20+
with:
21+
java-version: '17'
22+
distribution: 'temurin'
23+
24+
- name: Make Gradle wrapper executable
25+
run: chmod +x ./gradlew
26+
27+
- name: Build
28+
run: ./gradlew build
29+
30+
- name: Upload JAR to GitHub Release
31+
uses: softprops/action-gh-release@v2
32+
with:
33+
files: build/libs/*.jar

build.gradle

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,16 @@ tasks.test {
221221

222222
//def reobfJarFile = tasks.named('jar').get().archiveFile.get().asFile.absolutePath
223223

224+
publishing {
225+
publications {
226+
mavenJava(MavenPublication) {
227+
from components.java
228+
}
229+
}
230+
}
231+
232+
//the jreleaser doesn't work
233+
//todo find why and fix it
224234
jreleaser {
225235
project {
226236
name = 'FormicAPI'

0 commit comments

Comments
 (0)