Skip to content

v1.4.4

v1.4.4 #2

name: Application packaging
run-name: ${{ github.ref_name }}
on:
workflow_dispatch:
push:
tags:
- v*
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '19'
distribution: 'temurin'
cache: maven
- name: Maven build
run: mvn -B verify
- name: Rename shaded jar
run: mv ${{github.workspace}}/bspsrc-app/target/*-shaded.jar ${{github.workspace}}/bspsrc-app/target/bspsrc.jar
- name: Upload application jar
uses: actions/[email protected]
with:
name: bspsrc.jar
path: ${{github.workspace}}/bspsrc-app/target/bspsrc.jar
if-no-files-found: error
retention-days: 1
package-app:
name: "Package application: ${{ matrix.options.type }}"
needs: build
strategy:
matrix:
options: [
{ type: "jar-only", os: "ubuntu-latest", include_runtime: false, linux_launcher: true, windows_launcher: true, java_path: "" },
{ type: "linux", os: "ubuntu-latest", include_runtime: true, linux_launcher: true, windows_launcher: false, java_path: "$BASEDIR/runtime/bin/" },
{ type: "windows", os: "windows-latest", include_runtime: true, linux_launcher: false, windows_launcher: true, java_path: "%~dp0\\\\runtime\\\\bin\\\\" }
]
runs-on: ${{ matrix.options.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: 19
distribution: temurin
cache: maven
- name: Download application jar
uses: actions/download-artifact@v3
with:
name: bspsrc.jar
path: packaging
- name: Copy Linux launcher scripts
if: ${{ matrix.options.linux_launcher }}
run: |
sed 's!<java_path>!${{ matrix.options.java_path }}!g' ${{ github.workspace }}/bspsrc-app/scripts/bspinfo.sh > packaging/bspinfo.sh
sed 's!<java_path>!${{ matrix.options.java_path }}!g' ${{ github.workspace }}/bspsrc-app/scripts/bspsrc.sh > packaging/bspsrc.sh
chmod +x packaging/bspinfo.sh packaging/bspsrc.sh
- name: Copy Windows launcher scripts
if: ${{ matrix.options.windows_launcher }}
run: |
sed 's!<java_path>!${{ matrix.options.java_path }}!g' ${{ github.workspace }}/bspsrc-app/scripts/bspinfo.bat > packaging/bspinfo.bat
sed 's!<java_path>!${{ matrix.options.java_path }}!g' ${{ github.workspace }}/bspsrc-app/scripts/bspsrc.bat > packaging/bspsrc.bat
- name: Generate runtime
if: ${{ matrix.options.include_runtime }}
run: jlink --add-modules java.desktop,java.logging,java.management --output packaging/runtime/ --strip-debug --no-man-pages --no-header-files --compress=2
- 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/[email protected]
with:
name: Artifacts
path: bspsrc-${{ matrix.options.type }}.zip
if-no-files-found: error
retention-days: 7