Stirling-PDF/.github/workflows/multiOSReleases.yml

90 lines
2.8 KiB
YAML
Raw Normal View History

2024-12-13 00:03:42 +01:00
name: Test Installers Build
on:
push:
branches:
- testStuff
workflow_dispatch:
permissions:
contents: write
packages: write
jobs:
build-installers:
strategy:
matrix:
include:
- os: windows-latest
platform: win
ext: exe
- os: macos-latest
platform: mac
ext: dmg
- os: ubuntu-latest
platform: linux
ext: deb
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: "21"
distribution: "temurin"
- uses: gradle/actions/setup-gradle@v4
with:
gradle-version: 8.7
# Install Windows dependencies
- name: Install WiX Toolset
if: matrix.os == 'windows-latest'
run: |
curl -L -o wix.exe https://github.com/wixtoolset/wix3/releases/download/wix3141rtm/wix314.exe
.\wix.exe /install /quiet
# Install Linux dependencies
- name: Install Linux Dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y fakeroot rpm
# Get version number
2024-12-13 00:40:49 +01:00
- name: Get version numbers
id: versions
run: |
echo "version=$(./gradlew printVersion --quiet | tail -1)" >> $GITHUB_OUTPUT
echo "macversion=$(./gradlew printMacVersion --quiet | tail -1)" >> $GITHUB_OUTPUT
2024-12-13 00:03:42 +01:00
shell: bash
2024-12-13 00:40:49 +01:00
2024-12-13 00:03:42 +01:00
# Build installer
- name: Build Installer
2024-12-13 00:08:28 +01:00
run: ./gradlew build jpackage --info
2024-12-13 00:03:42 +01:00
# Rename and collect artifacts based on OS
- name: Prepare artifacts
id: prepare
shell: bash
run: |
if [ "${{ matrix.os }}" = "windows-latest" ]; then
2024-12-13 00:40:49 +01:00
mv "Stirling-PDF-${{ steps.versions.outputs.version }}.exe" "Stirling-PDF-${{ steps.versions.outputs.version }}-${{ matrix.platform }}.${{ matrix.ext }}"
2024-12-13 00:03:42 +01:00
elif [ "${{ matrix.os }}" = "macos-latest" ]; then
2024-12-13 00:40:49 +01:00
mv "Stirling-PDF-${{ steps.versions.outputs.macversion }}.dmg" "Stirling-PDF-${{ steps.versions.outputs.version }}-${{ matrix.platform }}.${{ matrix.ext }}"
2024-12-13 00:03:42 +01:00
else
2024-12-13 00:40:49 +01:00
mv "stirlingpdf_${{ steps.versions.outputs.version }}-1_amd64.deb" "Stirling-PDF-${{ steps.versions.outputs.version }}-${{ matrix.platform }}.${{ matrix.ext }}"
2024-12-13 00:03:42 +01:00
fi
# Upload installer as artifact for testing
- name: Upload Installer Artifact
uses: actions/upload-artifact@v4
with:
name: Stirling-PDF-${{ matrix.platform }}.${{ matrix.ext }}
path: Stirling-PDF-${{ steps.versionNumber.outputs.versionNumber }}-${{ matrix.platform }}.${{ matrix.ext }}
retention-days: 1
if-no-files-found: error