Skip to content

Commit

Permalink
Lets test if we can have the Action create the release
Browse files Browse the repository at this point in the history
  • Loading branch information
torakiki committed Jan 22, 2025
1 parent 2c5cf7d commit 4318e6e
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 16 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: release

on:
push:
tags:
- '*'

permissions:
contents: write

jobs:
os_matrix:
strategy:
matrix:
os: [ macos-latest, ubuntu-latest, macos-13 ]
runs-on: ${{ matrix.os }}
name: build ${{ matrix.os }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_SUB_SECRET_KEY }}
passphrase: ${{ secrets.GPG_SUB_SECRET_KEY_PASSWORD }}
fingerprint: ${{ secrets.GPG_SUB_FINGERPRINT }}
- name: Set up Apple certs
if: runner.os == 'macOS'
uses: apple-actions/import-codesign-certs@v3
with:
p12-file-base64: ${{ secrets.APPLE_CERT_P12 }}
p12-password: ${{ secrets.APPLE_CERT_P12_PWD }}
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'liberica'
- name: Install gettext on Ubuntu
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get update && sudo apt-get install -y gettext

- name: Install gettext on macOS
if: matrix.os == 'macos-latest'
run: brew install gettext

- name: Install gettext on Windows
if: matrix.os == 'windows-latest'
run: choco install gettext --version=0.21.1
- name: Build
env:
APPLEID: ${{ secrets.NOTARIZE_ACCOUNT }}
APPLEIDPASS: ${{ secrets.NOTERIZE_PWD }}
TEAMID: ${{ secrets.NOTERIZE_TEAM_ID }}
PDFSAM_GPG_FINGERPRINT: ${{ secrets.GPG_SUB_FINGERPRINT }}
run: mvn clean install -DskipTests -Drelease --batch-mode
- name: Release
uses: softprops/action-gh-release@v2
with:
draft: true
files: |
pdfsam-basic/target/*.deb
pdfsam-basic/target/*.dmg
pdfsam-basic/target/*.deb.asc
pdfsam-basic/target/*.dmg.asc
18 changes: 9 additions & 9 deletions pdfsam-basic/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@
<goal>single</goal>
</goals>
<configuration>
<finalName>pdfsam-${project.version}-${os.detected.name}</finalName>
<finalName>pdfsam-basic-${project.version}-${os.detected.classifier}</finalName>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/assembly/portable-win.xml</descriptor>
Expand Down Expand Up @@ -372,7 +372,7 @@
<artifacts>
<artifact>
<file>
${project.build.directory}/pdfsam-${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.msi
${project.build.directory}/pdfsam-basic-${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}-${os.detected.classifier}.msi
</file>
<type>msi</type>
</artifact>
Expand Down Expand Up @@ -407,7 +407,7 @@
<goal>single</goal>
</goals>
<configuration>
<finalName>pdfsam-${project.version}-${os.detected.name}</finalName>
<finalName>pdfsam-basic-${project.version}-${os.detected.classifier}</finalName>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/assembly/portable-linux.xml</descriptor>
Expand All @@ -427,7 +427,7 @@
<goal>jdeb</goal>
</goals>
<configuration>
<deb>[[buildDir]]/pdfsam_[[version]]-1_amd64.[[extension]]</deb>
<deb>[[buildDir]]/pdfsam-basic_[[version]]-1_amd64.[[extension]]</deb>
<dataSet>
<data>
<src>${project.build.directory}/assembled/bin/pdfsam.sh</src>
Expand Down Expand Up @@ -511,7 +511,7 @@
<goal>single</goal>
</goals>
<configuration>
<finalName>pdfsam-${project.version}-${os.detected.name}</finalName>
<finalName>pdfsam-basic-${project.version}-${os.detected.classifier}</finalName>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/assembly/portable.xml</descriptor>
Expand Down Expand Up @@ -579,7 +579,7 @@
<argument>Open source desktop application to split, merge, rotate, extract pages and mix PDF files
</argument>
<argument>--copyright</argument>
<argument>Copyright 2023, Sober Lemur S.r.l.</argument>
<argument>Copyright 2025, Sober Lemur S.r.l.</argument>
<argument>--vendor</argument>
<argument>Sober Lemur S.r.l.</argument>
<argument>--icon</argument>
Expand Down Expand Up @@ -654,7 +654,7 @@
<configuration>
<artifacts>
<artifact>
<file>${project.build.directory}/pdfsam-${project.version}.dmg</file>
<file>${project.build.directory}/pdfsam-basic-${project.version}-${os.detected.classifier}.dmg</file>
<type>dmg</type>
</artifact>
</artifacts>
Expand All @@ -670,9 +670,9 @@
<build>
<extensions>
<extension>
<groupId>kr.motd.maven</groupId>
<groupId>org.pdfsam.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.7.1</version>
<version>2.0.0</version>
</extension>
</extensions>
<resources>
Expand Down
2 changes: 1 addition & 1 deletion pdfsam-basic/src/deb/doc/copyright
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Upstream-Contact: Andrea Vacondio ([email protected])
Source: https://github.com/torakiki/pdfsam/

Files: *
Copyright: 2010-2022 Sober Lemur S.r.l. ([email protected])
Copyright: 2010-2025 Sober Lemur S.r.l. ([email protected])
License: AGPL-3.0
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the
Expand Down
10 changes: 8 additions & 2 deletions pdfsam-basic/src/dmg/notarize_dmg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,16 @@
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
mv "${project.build.directory}/PDFsam Basic-${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.dmg" "${project.build.directory}/pdfsam-${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.dmg" || exit 1

# Define the source and target file names
SOURCE_FILE="${project.build.directory}/PDFsam Basic-${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.dmg"
TARGET_FILE="${project.build.directory}/pdfsam-basic-${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}-${os.detected.classifier}.dmg"

# Rename the file with the appropriate suffix
mv "$SOURCE_FILE" "$TARGET_FILE" || exit 1
echo "dmg renamed"

xcrun notarytool submit --apple-id $APPLEID --password $APPLEIDPASS --team-id $TEAMID "${project.build.directory}/pdfsam-${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.dmg" || exit 1
xcrun notarytool submit --apple-id $APPLEID --password $APPLEIDPASS --team-id $TEAMID "$TARGET_FILE" || exit 1
echo "dmg notarized"

#stapling takes some time and it fails when run right after the notarization, we should probably wait few minutes
Expand Down
4 changes: 2 additions & 2 deletions pdfsam-basic/src/msi/Build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if %ERRORLEVEL% NEQ 0 goto error
ECHO "candle run ok"

REM English
IF EXIST pdfsam.wixobj "%WIX%bin\light.exe" pdfsam.wixobj verifyWithLanguageDlg.wixobj featuresTree.wixobj exitDlg.wixobj harvestedFiles.wixobj -b "${project.build.directory}/image/pdfsam" -ext WixUIExtension -ext WixUtilExtension -ext WixNetFxExtension -spdb -out "${project.build.directory}/pdfsam-%PDFSAM_VERSION%.msi" -loc "culture.wxl" -cultures:en-us
IF EXIST pdfsam.wixobj "%WIX%bin\light.exe" pdfsam.wixobj verifyWithLanguageDlg.wixobj featuresTree.wixobj exitDlg.wixobj harvestedFiles.wixobj -b "${project.build.directory}/image/pdfsam" -ext WixUIExtension -ext WixUtilExtension -ext WixNetFxExtension -spdb -out "${project.build.directory}/pdfsam-basic-%PDFSAM_VERSION%-${os.detected.classifier}.msi" -loc "culture.wxl" -cultures:en-us
if %ERRORLEVEL% NEQ 0 goto error
ECHO "MSI created"

Expand All @@ -33,7 +33,7 @@ del /Q verifyWithLanguageDlg.wixobj
del /Q exitDlg.wixobj
del /Q harvestedFiles.wixobj

IF EXIST "${project.build.directory}/pdfsam-%PDFSAM_VERSION%.msi" "signtool.exe" sign /fd sha256 /tr http://timestamp.sectigo.com /td sha256 /sha1 "%SIGN_CERT_FINGERPRINT%" /d "PDFsam Basic" "${project.build.directory}/pdfsam-%PDFSAM_VERSION%.msi"
IF EXIST "${project.build.directory}/pdfsam-basic-%PDFSAM_VERSION%-${os.detected.classifier}.msi" "signtool.exe" sign /fd sha256 /tr http://timestamp.sectigo.com /td sha256 /sha1 "%SIGN_CERT_FINGERPRINT%" /d "PDFsam Basic" "${project.build.directory}/pdfsam-basic-%PDFSAM_VERSION%-${os.detected.classifier}.msi"
if %ERRORLEVEL% NEQ 0 goto error
ECHO "MSI signed"
POPD
Expand Down
5 changes: 3 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.pdfsam</groupId>
<artifactId>pdfsam-parent</artifactId>
Expand Down Expand Up @@ -146,7 +147,7 @@
<goal>sign</goal>
</goals>
<configuration>
<keyname>${env.PDFSAM_GPG_KEYID}</keyname>
<keyFingerprintEnvName>PDFSAM_GPG_FINGERPRINT</keyFingerprintEnvName>
</configuration>
</execution>
</executions>
Expand Down

0 comments on commit 4318e6e

Please sign in to comment.