diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4c6739c..14203ee 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -261,6 +261,18 @@ jobs: find build/jpackage -name "*.deb" -exec sh -c 'x="{}"; mv "$x" "${{ env.OUTPUT_FILE_NAME }}"' \; echo "OUTPUT_FILE=$(realpath ${{ env.OUTPUT_FILE_NAME }})" >> $GITHUB_ENV + - name: Create Linux RPM installer (Fedora/RHEL) + if: startsWith(matrix.os, 'ubuntu') + run: | + sudo apt-get update + sudo apt-get install -y rpm + rm -rf build/jpackage + ./gradlew --info --stacktrace jpackage -PinstallerType=rpm --rerun-tasks + RPM_FILE_NAME="fqlite-${{ needs.get-version.outputs.version }}-$(uname -m).rpm" + mv "$(find build/jpackage -name '*.rpm' | head -n1)" "$RPM_FILE_NAME" + echo "RPM_OUTPUT_FILE_NAME=$RPM_FILE_NAME" >> $GITHUB_ENV + echo "RPM_OUTPUT_FILE=$(realpath $RPM_FILE_NAME)" >> $GITHUB_ENV + - name: Create Windows installer if: startsWith(matrix.os, 'windows') run: | @@ -297,6 +309,21 @@ jobs: overwrite: true retention-days: 14 + - name: Generate RPM artifact attestation + if: startsWith(matrix.os, 'ubuntu') + uses: actions/attest-build-provenance@v2 + with: + subject-path: "${{ env.RPM_OUTPUT_FILE }}" + + - name: Upload RPM artifact + if: startsWith(matrix.os, 'ubuntu') + uses: actions/upload-artifact@v4 + with: + name: "${{ env.RPM_OUTPUT_FILE_NAME }}" + path: "${{ env.RPM_OUTPUT_FILE }}" + overwrite: true + retention-days: 14 + publish: name: Publish release artefacts runs-on: ubuntu-latest diff --git a/.github/workflows/build_secure.yml b/.github/workflows/build_secure.yml index 4c6739c..14203ee 100644 --- a/.github/workflows/build_secure.yml +++ b/.github/workflows/build_secure.yml @@ -261,6 +261,18 @@ jobs: find build/jpackage -name "*.deb" -exec sh -c 'x="{}"; mv "$x" "${{ env.OUTPUT_FILE_NAME }}"' \; echo "OUTPUT_FILE=$(realpath ${{ env.OUTPUT_FILE_NAME }})" >> $GITHUB_ENV + - name: Create Linux RPM installer (Fedora/RHEL) + if: startsWith(matrix.os, 'ubuntu') + run: | + sudo apt-get update + sudo apt-get install -y rpm + rm -rf build/jpackage + ./gradlew --info --stacktrace jpackage -PinstallerType=rpm --rerun-tasks + RPM_FILE_NAME="fqlite-${{ needs.get-version.outputs.version }}-$(uname -m).rpm" + mv "$(find build/jpackage -name '*.rpm' | head -n1)" "$RPM_FILE_NAME" + echo "RPM_OUTPUT_FILE_NAME=$RPM_FILE_NAME" >> $GITHUB_ENV + echo "RPM_OUTPUT_FILE=$(realpath $RPM_FILE_NAME)" >> $GITHUB_ENV + - name: Create Windows installer if: startsWith(matrix.os, 'windows') run: | @@ -297,6 +309,21 @@ jobs: overwrite: true retention-days: 14 + - name: Generate RPM artifact attestation + if: startsWith(matrix.os, 'ubuntu') + uses: actions/attest-build-provenance@v2 + with: + subject-path: "${{ env.RPM_OUTPUT_FILE }}" + + - name: Upload RPM artifact + if: startsWith(matrix.os, 'ubuntu') + uses: actions/upload-artifact@v4 + with: + name: "${{ env.RPM_OUTPUT_FILE_NAME }}" + path: "${{ env.RPM_OUTPUT_FILE }}" + overwrite: true + retention-days: 14 + publish: name: Publish release artefacts runs-on: ubuntu-latest diff --git a/build.gradle b/build.gradle index 2ec9c39..32de50a 100644 --- a/build.gradle +++ b/build.gradle @@ -204,7 +204,16 @@ runtime { if (currentOs.windows) { installerOptions += ['--win-per-user-install', '--win-dir-chooser', '--win-menu', '--win-shortcut'] } else if (currentOs.linux) { + // jpackage defaults to the native package type of the build host + // (deb on Ubuntu). Pass -PinstallerType=rpm to build an RPM for + // Fedora/RHEL instead (requires rpmbuild on the build machine). + if (project.hasProperty('installerType')) { + installerType = project.property('installerType') + } installerOptions += ['--linux-package-name', 'fqlite', '--linux-shortcut'] + if (project.findProperty('installerType') == 'rpm') { + installerOptions += ['--linux-rpm-license-type', 'ASL 2.0'] + } } else if (currentOs.isMacOsX()) { imageOptions += ['--mac-package-name', 'fqlite'] skipInstaller = true