Skip to content

Commit fec9631

Browse files
committed
ci: added release workflow + minor build file updates
1 parent f0eef33 commit fec9631

File tree

5 files changed

+142
-27
lines changed

5 files changed

+142
-27
lines changed

.github/workflows/release.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Release version'
8+
required: true
9+
10+
jobs:
11+
release:
12+
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
environment: jreleaser
17+
env:
18+
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
20+
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
21+
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
22+
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.MAVENCENTRAL_USERNAME }}
23+
JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.MAVENCENTRAL_PASSWORD }}
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v5
28+
with:
29+
fetch-depth: 0
30+
31+
- name: Set up JDK 21
32+
uses: actions/setup-java@v5
33+
with:
34+
java-version: '21'
35+
distribution: 'temurin'
36+
cache: maven
37+
38+
- name: Set release version
39+
run: ./mvnw --no-transfer-progress --batch-mode versions:set -DnewVersion=${{ github.event.inputs.version }}
40+
41+
- name: Stage assemble
42+
run: ./mvnw --no-transfer-progress --batch-mode clean deploy jreleaser:assemble -Prelease
43+
44+
- name: Commit & Push changes
45+
uses: actions-js/push@master
46+
with:
47+
github_token: ${{ secrets.GITHUB_TOKEN }}
48+
message: "ci: Releasing version ${{ github.event.inputs.version }}"
49+
50+
- name: Stage release
51+
run: ./mvnw jreleaser:full-release
52+
53+
- name: Set development version
54+
run: ./mvnw --no-transfer-progress --batch-mode build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion}-SNAPSHOT versions:commit
55+
56+
- name: Commit & Push changes
57+
uses: actions-js/push@master
58+
with:
59+
github_token: ${{ secrets.GITHUB_TOKEN }}
60+
message: "ci: Prepare for next development iteration"
61+
62+
- name: JReleaser release output
63+
if: always()
64+
uses: actions/upload-artifact@v5
65+
with:
66+
name: jreleaser-release-output
67+
path: |
68+
target/surefire-reports
69+
target/jreleaser/trace.log
70+
target/jreleaser/output.properties
File renamed without changes.

app.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: jvm
2+
description: A command line tool that helps you install and manage multiple Java versions on your machine.
3+
authors:
4+
- Tako Schotanus (tako@codejive.org)
5+
links:
6+
homepage: https://github.com/codejive/java-jvm
7+
repository: https://github.com/codejive/java-jpm
8+
documentation: https://github.com/codejive/java-jvm/blob/main/README.md
9+
java: 11
10+
dependencies:
11+
- dev.jbang:devkitman:0.1.4
12+
- de.vandemeer:asciitable:0.3.2
13+
- info.picocli:picocli:4.7.7
14+
- org.yaml:snakeyaml:2.5
15+
- org.slf4j:slf4j-api:2.0.17
16+
- org.slf4j:slf4j-simple:2.0.17
17+
actions:
18+
clean: ./mvnw clean
19+
build: ./mvnw spotless:apply package -DskipTests
20+
run: ./target/binary/bin/jvm
21+
test: ./mvnw test

jreleaser.yml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ project:
1111
license: Apache-2.0
1212
links:
1313
homepage: https://github.com/codejive/java-jvm
14-
java:
15-
groupId: org.codejive.jvm
16-
version: 8
17-
mainClass: org.codejive.jvm.Main
18-
inceptionYear: 2024
14+
languages:
15+
java:
16+
groupId: org.codejive.jvm
17+
version: '8'
18+
mainClass: org.codejive.jvm.Main
19+
inceptionYear: '2024'
1920
stereotype: CLI
2021

2122
assemble:
@@ -29,18 +30,22 @@ assemble:
2930
path: 'target/{{distributionName}}-{{projectVersion}}.jar'
3031
jars:
3132
- pattern: 'target/binary/lib/*.jar'
33+
fileSets:
34+
- input: '.'
35+
includes:
36+
- 'LICENSE'
3237

3338
nativeImage:
3439
jvm-native:
3540
active: NEVER
3641
java:
37-
version: 22
42+
version: '25'
3843
imageName: '{{distributionName}}-{{projectEffectiveVersion}}'
3944
executable: jvm
4045
mainJar:
4146
path: 'target/{{distributionName}}-{{projectVersion}}-cli.jar'
4247
graalJdks:
43-
- path: 'C:\Users\tako\.jbang\cache\jdks\22'
48+
- path: 'C:\Users\tako\.jbang\cache\jdks\25'
4449
platform: 'windows-x86_64'
4550
upx:
4651
active: NEVER
@@ -54,12 +59,10 @@ assemble:
5459

5560
deploy:
5661
maven:
57-
nexus2:
58-
maven-central:
62+
mavenCentral:
63+
jvm:
5964
active: RELEASE
60-
url: https://s01.oss.sonatype.org/service/local
61-
closeRepository: true
62-
releaseRepository: true
65+
url: https://central.sonatype.com/api/v1/publisher
6366
stagingRepositories:
6467
- target/staging-deploy
6568

pom.xml

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@
3232
<maven.compiler.source>11</maven.compiler.source>
3333
<maven.compiler.target>11</maven.compiler.target>
3434
<mainClass>org.codejive.jvm.Main</mainClass>
35-
3635
<version.devkitman>0.1.4</version.devkitman>
37-
<version.snakeyaml>2.5</version.snakeyaml>
38-
<version.picocli>4.7.7</version.picocli>
3936
<version.asciitable>0.3.2</version.asciitable>
37+
<version.picocli>4.7.7</version.picocli>
38+
<version.snakeyaml>2.5</version.snakeyaml>
4039
<version.slf4j>2.0.17</version.slf4j>
41-
<version.jspecify>1.0.0</version.jspecify>
42-
4340
<version.spotless>3.0.0</version.spotless>
4441
<version.google-java-format>1.22.0</version.google-java-format>
42+
<version.junit>6.0.0</version.junit>
43+
<version.mockito>5.20.0</version.mockito>
44+
<version.assertj>3.27.6</version.assertj>
4545
</properties>
4646

4747
<dependencies>
@@ -51,19 +51,19 @@
5151
<version>${version.devkitman}</version>
5252
</dependency>
5353
<dependency>
54-
<groupId>org.yaml</groupId>
55-
<artifactId>snakeyaml</artifactId>
56-
<version>${version.snakeyaml}</version>
54+
<groupId>de.vandermeer</groupId>
55+
<artifactId>asciitable</artifactId>
56+
<version>${version.asciitable}</version>
5757
</dependency>
5858
<dependency>
5959
<groupId>info.picocli</groupId>
6060
<artifactId>picocli</artifactId>
6161
<version>${version.picocli}</version>
6262
</dependency>
6363
<dependency>
64-
<groupId>de.vandermeer</groupId>
65-
<artifactId>asciitable</artifactId>
66-
<version>${version.asciitable}</version>
64+
<groupId>org.yaml</groupId>
65+
<artifactId>snakeyaml</artifactId>
66+
<version>${version.snakeyaml}</version>
6767
</dependency>
6868
<dependency>
6969
<groupId>org.slf4j</groupId>
@@ -75,10 +75,31 @@
7575
<artifactId>slf4j-simple</artifactId>
7676
<version>${version.slf4j}</version>
7777
</dependency>
78+
79+
<!-- Test dependencies -->
80+
<dependency>
81+
<groupId>org.junit.jupiter</groupId>
82+
<artifactId>junit-jupiter</artifactId>
83+
<version>${version.junit}</version>
84+
<scope>test</scope>
85+
</dependency>
86+
<dependency>
87+
<groupId>org.mockito</groupId>
88+
<artifactId>mockito-core</artifactId>
89+
<version>${version.mockito}</version>
90+
<scope>test</scope>
91+
</dependency>
92+
<dependency>
93+
<groupId>org.mockito</groupId>
94+
<artifactId>mockito-junit-jupiter</artifactId>
95+
<version>${version.mockito}</version>
96+
<scope>test</scope>
97+
</dependency>
7898
<dependency>
79-
<groupId>org.jspecify</groupId>
80-
<artifactId>jspecify</artifactId>
81-
<version>${version.jspecify}</version>
99+
<groupId>org.assertj</groupId>
100+
<artifactId>assertj-core</artifactId>
101+
<version>${version.assertj}</version>
102+
<scope>test</scope>
82103
</dependency>
83104
</dependencies>
84105

@@ -355,4 +376,4 @@
355376
<developerConnection>scm:git:git@github.com:codejive/java-jvm.git</developerConnection>
356377
<url>http://github.com/codejive/java-jvm</url>
357378
</scm>
358-
</project>
379+
</project>

0 commit comments

Comments
 (0)