Skip to content

Custom Fork Build

Custom Fork Build #1

name: Custom Fork Build
on:
workflow_dispatch: {}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: 21
distribution: temurin
- name: Set version in pom.xml to 23.0
run: |
sed -i '0,/<version>.*<\/version>/s//<version>23.0<\/version>/' pom.xml
- name: Build with branch override
run: mvn package --file pom.xml -Dproject.branch=master
- name: Get correct jar
id: jar
run: |
mkdir staging
for file in target/*.jar; do
if [[ "$(basename "$file")" != original-* ]]; then
cp "$file" staging/
echo "jar_name=$(basename "$file")" >> "$GITHUB_OUTPUT"
break
fi
done
- name: Upload the .jar directly
uses: actions/upload-artifact@v4
with:
name: ${{ steps.jar.outputs.jar_name }}
path: staging/${{ steps.jar.outputs.jar_name }}
compression-level: 0