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
51 changes: 51 additions & 0 deletions .github/workflows/release-jar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Release agent JAR

# On a v* tag, build the shadow (fat) JAR and publish it as a downloadable
# GitHub Release asset named gpufl-agent.jar. Users grab it from the releases
# page or the stable URL:
# https://github.com/gpu-flight/gpufl-agent/releases/latest/download/gpufl-agent.jar
# and run it with `java -jar gpufl-agent.jar`. Runs alongside publish-image.yml,
# which ships the same JAR as a ghcr image for the monitor container.

on:
push:
tags:
- 'v*'

permissions:
contents: write # create the release + upload the asset

jobs:
release-jar:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

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

- name: Resolve version from tag
id: ver
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"

- name: Build fat JAR
run: |
chmod +x ./gradlew
./gradlew shadowJar --no-daemon -PagentVersion="${{ steps.ver.outputs.version }}"

- name: Stage release asset
run: |
mkdir -p release
cp build/libs/*-all.jar release/gpufl-agent.jar

- name: Publish GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "$GITHUB_REF_NAME" release/gpufl-agent.jar \
--title "gpufl-agent ${{ steps.ver.outputs.version }}" \
--generate-notes \
|| gh release upload "$GITHUB_REF_NAME" release/gpufl-agent.jar --clobber
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ plugins {
}

group = 'com.gpuflight'
version = '1.0-SNAPSHOT'
// Release CI passes -PagentVersion=<tag> so the JAR carries the real version;
// local builds fall back to the SNAPSHOT.
version = findProperty('agentVersion') ?: '1.0-SNAPSHOT'

repositories {
mavenCentral()
Expand Down
Loading