Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 67 additions & 8 deletions .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ on:
- master

jobs:
release:
prepare:
if: github.event.pull_request.merged == true && github.head_ref == 'develop'
runs-on: ubuntu-latest

outputs:
version: ${{ steps.bump_version.outputs.version }}

steps:

- name: Checkout master branch
Expand All @@ -32,23 +35,79 @@ jobs:
run: |
mvn versions:set -DremoveSnapshot=true -DgenerateBackupPoms=false
NEW_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "VERSION=$NEW_VERSION" >> $GITHUB_ENV
echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT

- name: Commit and Push to Master
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git commit -am "chore: release version ${{ env.VERSION }}"
git commit -am "chore: release version ${{ steps.bump_version.outputs.version }}"
git push origin master

- name: Package Application
package:
if: github.event.pull_request.merged == true && github.head_ref == 'develop'
needs: prepare
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
profile:
- win-x86-64
- linux-x86-64
- linux-aarch64

steps:

- name: Checkout master branch
uses: actions/checkout@v4
with:
ref: master
token: ${{ secrets.PAT_TOKEN }}

- name: Set up JDK 25
uses: actions/setup-java@v4
with:
java-version: '25'
distribution: 'temurin'
cache: 'maven'

- name: Package Application (${{ matrix.profile }})
# Tests are skipped because they already passed in the PR Validation workflow
run: mvn clean package -DskipTests
run: mvn clean package -DskipTests -P${{ matrix.profile }}

- name: Copy release jar with profile suffix
shell: bash
run: |
mkdir -p dist
VERSION='${{ needs.prepare.outputs.version }}'
JAR_NAME="VGreeter-${VERSION}-${{ matrix.profile }}.jar"
cp target/*.jar "dist/${JAR_NAME}"

- name: Upload release artifact
uses: actions/upload-artifact@v4
with:
name: VGreeter-${{ needs.prepare.outputs.version }}-${{ matrix.profile }}
path: dist/*.jar
if-no-files-found: error

release:
if: github.event.pull_request.merged == true && github.head_ref == 'develop'
needs: [prepare, package]
runs-on: ubuntu-latest

steps:

- name: Download all release artifacts
uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true

- name: Publish GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ env.VERSION }}
name: Release v${{ env.VERSION }}
files: target/*.jar
tag_name: v${{ needs.prepare.outputs.version }}
name: Release v${{ needs.prepare.outputs.version }}
files: dist/*.jar
generate_release_notes: true
88 changes: 58 additions & 30 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
</dependency>

<!-- Discord -->
<dependency>
Expand All @@ -53,21 +49,6 @@
<artifactId>jdave-api</artifactId>
<version>${jdave.version}</version>
</dependency>
<dependency>
<groupId>club.minnced</groupId>
<artifactId>jdave-native-win-x86-64</artifactId>
<version>${jdave.version}</version>
</dependency>
<dependency>
<groupId>club.minnced</groupId>
<artifactId>jdave-native-linux-x86-64</artifactId>
<version>${jdave.version}</version>
</dependency>
<dependency>
<groupId>club.minnced</groupId>
<artifactId>jdave-native-linux-aarch64</artifactId>
<version>${jdave.version}</version>
</dependency>

<!-- Opus processing -->
<dependency>
Expand All @@ -81,12 +62,6 @@
<version>0.8</version>
</dependency>

<!-- Logging -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>

<!-- JSON parsing -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
Expand Down Expand Up @@ -133,6 +108,11 @@

<plugins>

<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
Expand All @@ -155,12 +135,60 @@
</configuration>
</plugin>

<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>

</plugins>
</build>

<profiles>
<profile>
<id>win-x86-64</id>
<activation>
<os>
<family>Windows</family>
<arch>amd64</arch>
</os>
</activation>
<dependencies>
<dependency>
<groupId>club.minnced</groupId>
<artifactId>jdave-native-win-x86-64</artifactId>
<version>${jdave.version}</version>
</dependency>
</dependencies>
</profile>

<profile>
<id>linux-x86-64</id>
<activation>
<os>
<name>Linux</name>
<arch>amd64</arch>
</os>
</activation>
<dependencies>
<dependency>
<groupId>club.minnced</groupId>
<artifactId>jdave-native-linux-x86-64</artifactId>
<version>${jdave.version}</version>
</dependency>
</dependencies>
</profile>

<profile>
<id>linux-aarch64</id>
<activation>
<os>
<name>Linux</name>
<arch>aarch64</arch>
</os>
</activation>
<dependencies>
<dependency>
<groupId>club.minnced</groupId>
<artifactId>jdave-native-linux-aarch64</artifactId>
<version>${jdave.version}</version>
</dependency>
</dependencies>
</profile>
</profiles>

</project>
Loading