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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

102 lines
3.6 KiB
YAML
Raw Normal View History

2024-12-13 00:03:42 +01:00
name: Test Installers Build
on:
workflow_dispatch:
2024-12-13 19:20:54 +01:00
release:
types: [created]
2024-12-13 00:03:42 +01:00
permissions:
contents: write
packages: write
jobs:
build-installers:
strategy:
matrix:
include:
- os: windows-latest
platform: win
ext: exe
2024-12-13 17:04:45 +01:00
#- os: macos-latest
# platform: mac
# ext: dmg
#- os: ubuntu-latest
# platform: linux
# ext: deb
2024-12-13 00:03:42 +01:00
runs-on: ${{ matrix.os }}
2024-12-21 15:34:07 +01:00
2024-12-13 00:03:42 +01:00
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2024-12-13 00:03:42 +01:00
- name: Set up JDK 21
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
2024-12-13 00:03:42 +01:00
with:
java-version: "21"
distribution: "temurin"
- uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2
2024-12-13 00:03:42 +01:00
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
2024-12-21 15:34:07 +01:00
2024-12-13 00:03:42 +01:00
# 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:50:51 +01:00
- name: Get version number
id: versionNumber
run: echo "versionNumber=$(./gradlew printVersion --quiet | tail -1)" >> $GITHUB_OUTPUT
2024-12-13 00:03:42 +01:00
shell: bash
2024-12-13 01:44:32 +01:00
- name: Get version number mac
2024-12-13 00:50:51 +01:00
id: versionNumberMac
2024-12-13 01:44:32 +01:00
run: echo "versionNumberMac=$(./gradlew printMacVersion --quiet | tail -1)" >> $GITHUB_OUTPUT
2024-12-13 00:50:51 +01:00
shell: bash
2024-12-13 17:04:45 +01:00
2024-12-13 00:03:42 +01:00
# Build installer
- name: Build Installer
2024-12-13 01:13:47 +01:00
run: ./gradlew build jpackage -x test --info
2024-12-13 01:00:56 +01:00
env:
DOCKER_ENABLE_SECURITY: false
STIRLING_PDF_DESKTOP_UI: true
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-14 12:08:35 +01:00
mv "build/jpackage/Stirling-PDF-${{ steps.versionNumber.outputs.versionNumber }}.exe" "Stirling-PDF-${{ matrix.platform }}-installer.${{ matrix.ext }}"
2024-12-13 00:03:42 +01:00
elif [ "${{ matrix.os }}" = "macos-latest" ]; then
2024-12-13 01:44:32 +01:00
mv "build/jpackage/Stirling-PDF-${{ steps.versionNumberMac.outputs.versionNumberMac }}.dmg" "Stirling-PDF-${{ steps.versionNumber.outputs.versionNumber }}-${{ matrix.platform }}.${{ matrix.ext }}"
2024-12-13 00:03:42 +01:00
else
2024-12-13 01:44:32 +01:00
mv "build/jpackage/stirling-pdf_${{ steps.versionNumber.outputs.versionNumber }}-1_amd64.deb" "Stirling-PDF-${{ steps.versionNumber.outputs.versionNumber }}-${{ 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@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
2024-12-21 15:34:07 +01:00
with:
2024-12-14 12:08:35 +01:00
name: Stirling-PDF-${{ matrix.platform }}-installer.${{ matrix.ext }}
path: Stirling-PDF-${{ matrix.platform }}-installer.${{ matrix.ext }}
2024-12-13 00:03:42 +01:00
retention-days: 1
2024-12-14 12:08:35 +01:00
if-no-files-found: error
- name: Upload binaries to release
uses: softprops/action-gh-release@7b4da11513bf3f43f9999e90eabced41ab8bb048 # v2.2.0
2024-12-14 12:08:35 +01:00
with:
files: ./Stirling-PDF-${{ matrix.platform }}-installer.${{ matrix.ext }}