123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415 |
- name: Build Windows Installer
- on:
- release:
- types: [published]
- workflow_dispatch:
- inputs:
- version:
- description: 'Version'
- required: false
- isDebug:
- description: 'Build debug version with console output'
- type: boolean
- env:
- JAVA_DIST: 'zulu'
- JAVA_VERSION: '21.0.2+13'
- OPENJFX_JMODS_AMD64: 'https://download2.gluonhq.com/openjfx/21.0.1/openjfx-21.0.1_windows-x64_bin-jmods.zip'
- OPENJFX_JMODS_AMD64_HASH: 'daf8acae631c016c24cfe23f88469400274d3441dd890615a42dfb501f3eb94a'
- WINFSP_MSI: 'https://github.com/winfsp/winfsp/releases/download/v2.0/winfsp-2.0.23075.msi'
- WINFSP_UNINSTALLER: 'https://github.com/cryptomator/winfsp-uninstaller/releases/download/1.0.0/winfsp-uninstaller.exe'
- defaults:
- run:
- shell: bash
- jobs:
- get-version:
- uses: ./.github/workflows/get-version.yml
- with:
- version: ${{ inputs.version }}
- build-msi:
- name: Build .msi Installer
- runs-on: windows-latest
- needs: [get-version]
- env:
- LOOPBACK_ALIAS: 'cryptomator-vault'
- WIN_CONSOLE_FLAG: ''
- steps:
- - uses: actions/checkout@v4
- - name: Setup Java
- uses: actions/setup-java@v4
- with:
- distribution: ${{ env.JAVA_DIST }}
- java-version: ${{ env.JAVA_VERSION }}
- check-latest: true
- cache: 'maven'
- - name: Download and extract JavaFX jmods from Gluon
- #In the last step we move all jmods files a dir level up because jmods are placed inside a directory in the zip
- run: |
- curl --output jfxjmods.zip -L "${{ env.OPENJFX_JMODS_AMD64 }}"
- if(!(Get-FileHash -Path jfxjmods.zip -Algorithm SHA256).Hash.ToLower().equals("${{ env.OPENJFX_JMODS_AMD64_HASH }}")) {
- throw "Wrong checksum of JMOD archive downloaded from ${{ env.OPENJFX_JMODS_AMD64 }}.";
- }
- Expand-Archive -Path jfxjmods.zip -DestinationPath jfxjmods
- Get-ChildItem -Path jfxjmods -Recurse -Filter "*.jmod" | ForEach-Object { Move-Item -Path $_ -Destination $_.Directory.Parent}
- shell: pwsh
- - name: Ensure major jfx version in pom and in jmods is the same
- run: |
- JMOD_VERSION_AMD64=$(jmod describe jfxjmods/javafx.base.jmod | head -1)
- JMOD_VERSION_AMD64=${JMOD_VERSION_AMD64#*@}
- JMOD_VERSION_AMD64=${JMOD_VERSION_AMD64%%.*}
- POM_JFX_VERSION=$(mvn help:evaluate "-Dexpression=javafx.version" -q -DforceStdout)
- POM_JFX_VERSION=${POM_JFX_VERSION#*@}
- POM_JFX_VERSION=${POM_JFX_VERSION%%.*}
- if [ $POM_JFX_VERSION -ne $JMOD_VERSION_AMD64 ]; then
- >&2 echo "Major JavaFX version in pom.xml (${POM_JFX_VERSION}) != amd64 jmod version (${JMOD_VERSION_AMD64})"
- exit 1
- fi
- - name: Set version
- run
- - name: Run
- run: mvn
- - name: Patch
- run: |
- cp
- cp /cryptomator-*.jar target/
- - name: Run
- #Remark: no
- run: >
- ${JAVA_HOME}/bin/jlink
- --verbose
- --output
- --module-path
- --add-modules
- --strip-native-commands
- --no-header-files
- --no-man-pages
- --strip-debug
- --compress
- - name: Change
- if: ${{ inputs.isDebug
- run: echo
- - name: Run
- run: >
- ${JAVA_HOME}/bin/jpackage
- --verbose
- --type
- --runtime-image
- --input /libs
- --module-path target/
- --module /org.cryptomator.launcher.Cryptomator
- --dest appdir
- --name Cryptomator
- --vendor
- --copyright
- --app-version
- --java-options
- --java-options
- --java-options
- --java-options
- --java-options
- --java-options
- --java-options
- --java-options
- --java-options
- --java-options
- --java-options
- --java-options
- --java-options
- --java-options
- --java-options
- --java-options
- --java-options
- --java-options
- --java-options
- --resource-dir dist//resources
- --icon dist//resources/
- ${WIN_CONSOLE_FLAG}
- - name: Patch
- run: |
- cp /win//* appdir/
- - name: Set
- shell: pwsh
- run: |
- $patchScript
- try
- (Get-Content ` |
- } catch
- Write-Host
- exit
- }
- - name: Fix
- run: attrib /Cryptomator/
- shell: pwsh
- - name: Extract
- shell: pwsh
- run: |
- Add-Type
- $jarFolder
- $jarExtractDir
- #for
- Get-ChildItem |
- $jar
- if | |
- #jars
- Set-Location
- Expand-Archive
- }
- $jar.Dispose()
- }
- - name: Extract ///cryptomator//issues/
- shell: pwsh
- run: |
- New-Item /jpackage-jmod -ItemType Directory
- & $env:JAVA_HOME\bin\jmod.exe extract --dir jpackage-jmod
- Get-ChildItem -Recurse -Path -File wixhelper.dll | Select-Object -Last 1 | Copy-Item -Destination
- - name: Codesign
- uses: skymatic/
- with:
- certificate: ${{ secrets.WIN_CODESIGN_P12_BASE64
- password: ${{ secrets.WIN_CODESIGN_P12_PW
- certificatesha1: 5FC94CE149E5B511E621F53A060AC67CBD446B3A
- description: Cryptomator
- timestampUrl: 'http://timestamp.digicert.com'
- folder: appdir
- recursive: true
- - name: Replace
- shell: pwsh
- run: |
- $jarExtractDir
- $jarFolder
- Get-ChildItem |
- $jarName
- $jarFile
- Set-Location
- Get-ChildItem |
- # update
- jar
- }
- }
- - name: Generate
- run: >
- mvn
- "-Dlicense.thirdPartyFilename=license.rtf"
- "-Dlicense.outputDirectory=dist/win/resources"
- "-Dlicense.fileTemplate=dist/win/resources/licenseTemplate.ftl"
- "-Dlicense.includedScopes=compile"
- "-Dlicense.excludedGroups=^org\.cryptomator"
- "-Dlicense.failOnMissing=true"
- "-Dlicense.licenseMergesUrl=file:///${{ github.workspace }}/license/merges"
- shell: pwsh
- - name: Create
- run: >
- ${JAVA_HOME}/bin/jpackage
- --verbose
- --type
- --win-upgrade-uuid
- --app-image /Cryptomator
- --dest installer
- --name Cryptomator
- --vendor
- --copyright
- --app-version
- --win-menu
- --win-dir-chooser
- --win-shortcut-prompt
- --win-update-url
- --win-menu-group Cryptomator
- --resource-dir dist//resources
- --license-file dist//resources/
- --file-associations /win//FAvaultFile.properties
- env:
- JP_WIXWIZARD_RESOURCES: ${{ github.workspace }}//win//main.wxs
- JP_WIXHELPER_DIR: ${{ github.workspace }}\appdir
- - name: Codesign MSI
- uses: skymatic/
- with:
- certificate: ${{ secrets.WIN_CODESIGN_P12_BASE64
- password: ${{ secrets.WIN_CODESIGN_P12_PW
- certificatesha1: 5FC94CE149E5B511E621F53A060AC67CBD446B3A
- description: Cryptomator
- timestampUrl: 'http://timestamp.digicert.com'
- folder: installer
- - name: Add /beta tags to installer name
- run: mv installer/
- - name: Create
- run: |
- echo |
- echo |
- env:
- GPG_PRIVATE_KEY: ${{ secrets.RELEASES_GPG_PRIVATE_KEY
- GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE
- - name: Upload
- uses: actions/upload-artifact@v4
- with:
- name: msi
- path: |
- Cryptomator-*.msi
- Cryptomator-*.asc
- if-no-files-found: error
- - name: Publish .msi on GitHub Releases
- if: startsWith(github.ref, )
- uses: softprops/action-gh-release@v1
- with:
- fail_on_unmatched_files: true
- token: ${{ secrets.CRYPTOBOT_RELEASE_TOKEN
- files: |
- *.msi
- *.asc
- build-exe:
- name: Build
- runs-on: windows-latest
- needs: [get-version, build-msi]
- steps:
- - uses: actions/checkout@v4
- - name: Download .msi
- uses: actions/download-artifact@v4
- with:
- name: msi
- path: dist/win/bundle/resources
- - name: Strip version info from msi file name
- run: mv dist/win/bundle/resources/Cryptomator*.msi dist/win/bundle/resources/Cryptomator.msi
- - uses: actions/setup-java@v4
- with:
- distribution: ${{ env.JAVA_DIST
- java-version: ${{ env.JAVA_VERSION
- check-latest: true
- cache: 'maven'
- - name: Generate
- run: >
- mvn
- "-Dlicense.thirdPartyFilename=license.rtf"
- "-Dlicense.fileTemplate=dist/win/bundle/resources/licenseTemplate.ftl"
- "-Dlicense.outputDirectory=dist/win/bundle/resources"
- "-Dlicense.includedScopes=compile"
- "-Dlicense.excludedGroups=^org\.cryptomator"
- "-Dlicense.failOnMissing=true"
- "-Dlicense.licenseMergesUrl=file:///${{ github.workspace }}/license/merges"
- shell: pwsh
- - name: Download
- run: |
- curl /win//resources/
- shell: pwsh
- - name: Download
- run: |
- curl /win//resources/
- shell: pwsh
- - name: Compile
- run: >
- "${WIX}/bin/candle.exe" dist/win/bundle/bundleWithWinfsp.wxs
- -ext WixBalExtension
- -ext WixUtilExtension
- -out dist/win/bundle/
- -dBundleVersion="${{ needs.get-version.outputs.semVerNum }}.${{ needs.get-version.outputs.revNum }}"
- -dBundleVendor="Skymatic GmbH"
- -dBundleCopyright="(C) 2016 - 2024 Skymatic GmbH"
- -dAboutUrl="https://cryptomator.org"
- -dHelpUrl="https://cryptomator.org/contact"
- -dUpdateUrl="https://cryptomator.org/downloads/"
- - name: Create
- run: >
- "${WIX}/bin/light.exe" -b /win//win//bundleWithWinfsp.wixobj
- -ext WixBalExtension
- -ext WixUtilExtension
- -out installer//Cryptomator-Installer.exe
- - name: Detach burn engine in preparation to sign
- run: >
-
- -ib installer//Cryptomator-Installer.exe
- -o tmp/
- - name: Codesign
- uses: skymatic/code-sign-action@v2
- with:
- certificate: ${{ secrets.WIN_CODESIGN_P12_BASE64 }}
- password: ${{ secrets.WIN_CODESIGN_P12_PW }}
- certificatesha1: 5FC94CE149E5B511E621F53A060AC67CBD446B3A
- description: Cryptomator Installer
- timestampUrl:
- folder: tmp
- - name: Reattach signed burn engine to installer
- run : >
-
- -ab tmp/engine.exe /unsigned/
- -o /Cryptomator-Installer.exe
- - name: Codesign EXE
- uses: skymatic/
- with:
- certificate: ${{ secrets.WIN_CODESIGN_P12_BASE64
- password: ${{ secrets.WIN_CODESIGN_P12_PW
- certificatesha1: 5FC94CE149E5B511E621F53A060AC67CBD446B3A
- description: Cryptomator
- timestampUrl: 'http://timestamp.digicert.com'
- folder: installer
- - name: Add /beta tags to installer name
- run: mv installer/
- - name: Create
- run: |
- echo |
- echo |
- env:
- GPG_PRIVATE_KEY: ${{ secrets.RELEASES_GPG_PRIVATE_KEY
- GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE
- - name: Upload
- uses: actions/upload-artifact@v4
- with:
- name: exe
- path: |
- Cryptomator-*.exe
- Cryptomator-*.asc
- if-no-files-found: error
- - name: Publish .msi on GitHub Releases
- if: startsWith(github.ref, )
- uses: softprops/action-gh-release@v1
- with:
- fail_on_unmatched_files: true
- token: ${{ secrets.CRYPTOBOT_RELEASE_TOKEN
- files: |
- Cryptomator-*.exe
- Cryptomator-*.asc
- allowlist:
- name: Anti
- if: startsWith(github.ref, 'refs/tags/')
- runs-on: ubuntu-latest
- needs: [build-msi, build-exe]
- steps:
- - name: Download
- uses: actions/download-artifact@v4
- with:
- name: msi
- path: msi
- - name: Download .exe
- uses: actions/download-artifact@v4
- with:
- name: exe
- path: exe
- - name: Collect
- run: |
- mkdir
- cp /*.msi files
- cp exe
|