Skip to content

v1.4.6

v1.4.6 #5

name: Application packaging
run-name: ${{ github.ref_name }}
on:
workflow_dispatch:
push:
tags:
- v*
jobs:
build:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '22'
distribution: 'temurin'
cache: maven
- name: Maven test
run: mvn -B test
package-app:
name: "Package application: ${{ matrix.options.type }}"
needs: build
strategy:
matrix:
options: [
{ type: "jar-only", os: "ubuntu-latest", runtime-type: "local", linux_launcher: true, windows_launcher: true },
{ type: "linux", os: "ubuntu-latest", runtime-type: "img", linux_launcher: true, windows_launcher: false },
{ type: "windows", os: "windows-latest", runtime-type: "img", linux_launcher: false, windows_launcher: true }
]
runs-on: ${{ matrix.options.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 22
distribution: temurin
cache: maven
- name: Maven build
run: mvn -B verify
- name: Create packaging directory
run: mkdir packaging/
- name: Copy Linux launcher scripts
if: ${{ matrix.options.linux_launcher }}
run: |
python .github/scripts/create_launcher.py linux src ${{ matrix.options.runtime-type }} packaging/bspsrc.sh
python .github/scripts/create_launcher.py linux info ${{ matrix.options.runtime-type }} packaging/bspinfo.sh
- name: Copy Windows launcher scripts
if: ${{ matrix.options.windows_launcher }}
run: |
python .github/scripts/create_launcher.py windows src ${{ matrix.options.runtime-type }} packaging/bspsrc.bat
python .github/scripts/create_launcher.py windows info ${{ matrix.options.runtime-type }} packaging/bspinfo.bat
- name: Copy runtime
if: ${{ matrix.options.runtime-type == 'img' }}
run: cp -R bspsrc-app/target/maven-jlink/classifiers/runtime-image/* packaging/
- name: Copy application jar
if: ${{ matrix.options.runtime-type == 'local' }}
run: cp bspsrc-app/target/*-shaded.jar packaging/bspsrc.jar
# actions/upload-artifact doesn't preserve file permissions, so we need to zip ourselves...
- name: Zip files on linux
if: runner.os == 'Linux'
run: |
cd packaging/
zip -r ../bspsrc-${{ matrix.options.type }}.zip *
cd ..
- name: Zip files on windows
if: runner.os == 'Windows'
run: Compress-Archive packaging/* bspsrc-${{ matrix.options.type }}.zip
- name: Upload files
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.options.type }}
path: bspsrc-${{ matrix.options.type }}.zip
if-no-files-found: error
retention-days: 7