Skip to content

Build Jar

Build Jar #1

Workflow file for this run

name: Build Jar
on:
workflow_dispatch: # for manual trigger
push:
tags:
- 'v*' # for semantic versioning tags
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
- name: Extract tag name
shell: bash
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Update pom.xml with the tag version
run: mvn versions:set -DnewVersion=${{ env.VERSION }}
- name: Build with Maven
run: mvn clean package
- name: Clean up artifacts
run: rm target/original-*.jar
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: Build Artifacts
path: |
target/*.jar