Skip to content

Commit db30e03

Browse files
authored
Merge pull request #2 from devExcale/develop
2 parents 2af706c + 6920b7c commit db30e03

2 files changed

Lines changed: 125 additions & 38 deletions

File tree

.github/workflows/release-publish.yml

Lines changed: 67 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@ on:
88
- master
99

1010
jobs:
11-
release:
11+
prepare:
1212
if: github.event.pull_request.merged == true && github.head_ref == 'develop'
1313
runs-on: ubuntu-latest
1414

15+
outputs:
16+
version: ${{ steps.bump_version.outputs.version }}
17+
1518
steps:
1619

1720
- name: Checkout master branch
@@ -32,23 +35,79 @@ jobs:
3235
run: |
3336
mvn versions:set -DremoveSnapshot=true -DgenerateBackupPoms=false
3437
NEW_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
35-
echo "VERSION=$NEW_VERSION" >> $GITHUB_ENV
38+
echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT
3639
3740
- name: Commit and Push to Master
3841
run: |
3942
git config user.name "github-actions[bot]"
4043
git config user.email "github-actions[bot]@users.noreply.github.com"
41-
git commit -am "chore: release version ${{ env.VERSION }}"
44+
git commit -am "chore: release version ${{ steps.bump_version.outputs.version }}"
4245
git push origin master
4346
44-
- name: Package Application
47+
package:
48+
if: github.event.pull_request.merged == true && github.head_ref == 'develop'
49+
needs: prepare
50+
runs-on: ubuntu-latest
51+
52+
strategy:
53+
fail-fast: false
54+
matrix:
55+
profile:
56+
- win-x86-64
57+
- linux-x86-64
58+
- linux-aarch64
59+
60+
steps:
61+
62+
- name: Checkout master branch
63+
uses: actions/checkout@v4
64+
with:
65+
ref: master
66+
token: ${{ secrets.PAT_TOKEN }}
67+
68+
- name: Set up JDK 25
69+
uses: actions/setup-java@v4
70+
with:
71+
java-version: '25'
72+
distribution: 'temurin'
73+
cache: 'maven'
74+
75+
- name: Package Application (${{ matrix.profile }})
4576
# Tests are skipped because they already passed in the PR Validation workflow
46-
run: mvn clean package -DskipTests
77+
run: mvn clean package -DskipTests -P${{ matrix.profile }}
78+
79+
- name: Copy release jar with profile suffix
80+
shell: bash
81+
run: |
82+
mkdir -p dist
83+
VERSION='${{ needs.prepare.outputs.version }}'
84+
JAR_NAME="VGreeter-${VERSION}-${{ matrix.profile }}.jar"
85+
cp target/*.jar "dist/${JAR_NAME}"
86+
87+
- name: Upload release artifact
88+
uses: actions/upload-artifact@v4
89+
with:
90+
name: VGreeter-${{ needs.prepare.outputs.version }}-${{ matrix.profile }}
91+
path: dist/*.jar
92+
if-no-files-found: error
93+
94+
release:
95+
if: github.event.pull_request.merged == true && github.head_ref == 'develop'
96+
needs: [prepare, package]
97+
runs-on: ubuntu-latest
98+
99+
steps:
100+
101+
- name: Download all release artifacts
102+
uses: actions/download-artifact@v4
103+
with:
104+
path: dist
105+
merge-multiple: true
47106

48107
- name: Publish GitHub Release
49108
uses: softprops/action-gh-release@v2
50109
with:
51-
tag_name: v${{ env.VERSION }}
52-
name: Release v${{ env.VERSION }}
53-
files: target/*.jar
110+
tag_name: v${{ needs.prepare.outputs.version }}
111+
name: Release v${{ needs.prepare.outputs.version }}
112+
files: dist/*.jar
54113
generate_release_notes: true

pom.xml

Lines changed: 58 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@
3737
<groupId>org.springframework.boot</groupId>
3838
<artifactId>spring-boot-starter-data-jpa</artifactId>
3939
</dependency>
40-
<dependency>
41-
<groupId>org.springframework.boot</groupId>
42-
<artifactId>spring-boot-configuration-processor</artifactId>
43-
</dependency>
4440

4541
<!-- Discord -->
4642
<dependency>
@@ -53,21 +49,6 @@
5349
<artifactId>jdave-api</artifactId>
5450
<version>${jdave.version}</version>
5551
</dependency>
56-
<dependency>
57-
<groupId>club.minnced</groupId>
58-
<artifactId>jdave-native-win-x86-64</artifactId>
59-
<version>${jdave.version}</version>
60-
</dependency>
61-
<dependency>
62-
<groupId>club.minnced</groupId>
63-
<artifactId>jdave-native-linux-x86-64</artifactId>
64-
<version>${jdave.version}</version>
65-
</dependency>
66-
<dependency>
67-
<groupId>club.minnced</groupId>
68-
<artifactId>jdave-native-linux-aarch64</artifactId>
69-
<version>${jdave.version}</version>
70-
</dependency>
7152

7253
<!-- Opus processing -->
7354
<dependency>
@@ -81,12 +62,6 @@
8162
<version>0.8</version>
8263
</dependency>
8364

84-
<!-- Logging -->
85-
<dependency>
86-
<groupId>ch.qos.logback</groupId>
87-
<artifactId>logback-classic</artifactId>
88-
</dependency>
89-
9065
<!-- JSON parsing -->
9166
<dependency>
9267
<groupId>com.fasterxml.jackson.core</groupId>
@@ -133,6 +108,11 @@
133108

134109
<plugins>
135110

111+
<plugin>
112+
<groupId>org.springframework.boot</groupId>
113+
<artifactId>spring-boot-maven-plugin</artifactId>
114+
</plugin>
115+
136116
<plugin>
137117
<groupId>org.apache.maven.plugins</groupId>
138118
<artifactId>maven-compiler-plugin</artifactId>
@@ -155,12 +135,60 @@
155135
</configuration>
156136
</plugin>
157137

158-
<plugin>
159-
<groupId>org.springframework.boot</groupId>
160-
<artifactId>spring-boot-maven-plugin</artifactId>
161-
</plugin>
162-
163138
</plugins>
164139
</build>
165140

141+
<profiles>
142+
<profile>
143+
<id>win-x86-64</id>
144+
<activation>
145+
<os>
146+
<family>Windows</family>
147+
<arch>amd64</arch>
148+
</os>
149+
</activation>
150+
<dependencies>
151+
<dependency>
152+
<groupId>club.minnced</groupId>
153+
<artifactId>jdave-native-win-x86-64</artifactId>
154+
<version>${jdave.version}</version>
155+
</dependency>
156+
</dependencies>
157+
</profile>
158+
159+
<profile>
160+
<id>linux-x86-64</id>
161+
<activation>
162+
<os>
163+
<name>Linux</name>
164+
<arch>amd64</arch>
165+
</os>
166+
</activation>
167+
<dependencies>
168+
<dependency>
169+
<groupId>club.minnced</groupId>
170+
<artifactId>jdave-native-linux-x86-64</artifactId>
171+
<version>${jdave.version}</version>
172+
</dependency>
173+
</dependencies>
174+
</profile>
175+
176+
<profile>
177+
<id>linux-aarch64</id>
178+
<activation>
179+
<os>
180+
<name>Linux</name>
181+
<arch>aarch64</arch>
182+
</os>
183+
</activation>
184+
<dependencies>
185+
<dependency>
186+
<groupId>club.minnced</groupId>
187+
<artifactId>jdave-native-linux-aarch64</artifactId>
188+
<version>${jdave.version}</version>
189+
</dependency>
190+
</dependencies>
191+
</profile>
192+
</profiles>
193+
166194
</project>

0 commit comments

Comments
 (0)