From 5bc549d1ac6db04cee65a91bb7c68987da12f0df Mon Sep 17 00:00:00 2001 From: Tommy Aas Hjelle Date: Wed, 4 Feb 2026 17:09:23 +0100 Subject: [PATCH] Create buildOnRelease.yml Testing required --- .github/workflows/buildOnRelease.yml | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/buildOnRelease.yml diff --git a/.github/workflows/buildOnRelease.yml b/.github/workflows/buildOnRelease.yml new file mode 100644 index 0000000..8252101 --- /dev/null +++ b/.github/workflows/buildOnRelease.yml @@ -0,0 +1,33 @@ +name: Build and Attach Release JAR + +on: + release: + types: [created] + workflow_dispatch: + +jobs: + build: + runs-on: [self-hosted, linux, x64] + + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: '21' + cache: maven + + - run: mvn clean package + + - name: Set versioned JAR name + run: echo "JAR_NAME=APPLICATION-${GITHUB_REF#refs/tags/}.jar" >> $GITHUB_ENV + + - name: Rename JAR + run: mv target/*.jar $JAR_NAME + + - uses: softprops/action-gh-release@v1 + with: + files: ${{ env.JAR_NAME }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}