diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c3e254426..dca01d819 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,6 +2,11 @@ name: Installers and Release on: workflow_dispatch: + inputs: + semver: + description: 'SemVer' + required: true + default: '0.99.99-SNAPSHOT' push: tags: # see https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet - '[0-9]+.[0-9]+.[0-9]+' @@ -61,7 +66,7 @@ jobs: target/libs target/mods target/LICENSE.txt - target/${{ matrix.launcher }} + target/launcher* if-no-files-found: error # @@ -71,8 +76,9 @@ jobs: name: Determine Version Metadata runs-on: ubuntu-latest outputs: - versionStr: ${{ steps.versions.outputs.versionStr }} - versionNum: ${{ steps.versions.outputs.versionNum }} + semVerNum: ${{ steps.versions.outputs.semVerNum }} + semVerStr: ${{ steps.versions.outputs.semVerStr }} + ppaVerStr: ${{ steps.versions.outputs.ppaVerStr }} revNum: ${{ steps.versions.outputs.revNum }} steps: - uses: actions/checkout@v2 @@ -81,14 +87,19 @@ jobs: - id: versions run: | if [[ $GITHUB_REF == refs/tags/* ]]; then - VERSION_NUM=`echo ${GITHUB_REF##*/} | sed -E 's/([0-9]+\.[0-9]+\.[0-9]+).*/\1/'` - echo "::set-output name=versionStr::${GITHUB_REF##*/}" - echo "::set-output name=versionNum::${VERSION_NUM}" + SEM_VER_STR=${GITHUB_REF##*/} else - echo "::set-output name=versionStr::SNAPSHOT" - echo "::set-output name=versionNum::99.0.0" + SEM_VER_STR=${{ github.event.inputs.semver }} fi - echo "::set-output name=revNum::`git rev-list --count HEAD`" + SEM_VER_NUM=`echo ${SEM_VER_STR} | sed -E 's/([0-9]+\.[0-9]+\.[0-9]+).*/\1/'` + REVCOUNT=`git rev-list --count HEAD` + echo "::set-output name=semVerStr::${SEM_VER_STR}" + echo "::set-output name=semVerNum::${SEM_VER_NUM}" + echo "::set-output name=ppaVerStr::${SEM_VER_STR/-/\~}-${REVCOUNT}" + echo "::set-output name=revNum::${REVCOUNT}" + - uses: rubenesp87/semver-validation-action@0.0.6 + with: + version: ${{ steps.versions.outputs.semVerStr }} # # Application Directory @@ -104,9 +115,10 @@ jobs: - os: ubuntu-latest profile: linux jpackageoptions: > - --app-version "${{ needs.metadata.outputs.versionNum }}.${{ needs.metadata.outputs.revNum }}" + --app-version "${{ needs.metadata.outputs.semVerNum }}.${{ needs.metadata.outputs.revNum }}" --java-options "-Dfile.encoding=\"utf-8\"" --java-options "-Dcryptomator.logDir=\"~/.local/share/Cryptomator/logs\"" + --java-options "-Dcryptomator.pluginDir=\"~/.local/share/Cryptomator/plugins\"" --java-options "-Dcryptomator.settingsPath=\"~/.config/Cryptomator/settings.json:~/.Cryptomator/settings.json\"" --java-options "-Dcryptomator.ipcSocketPath=\"~/.config/Cryptomator/ipc.socket\"" --java-options "-Dcryptomator.mountPointsDir=\"~/.local/share/Cryptomator/mnt\"" @@ -116,9 +128,10 @@ jobs: - os: windows-latest profile: win jpackageoptions: > - --app-version "${{ needs.metadata.outputs.versionNum }}.${{ needs.metadata.outputs.revNum }}" + --app-version "${{ needs.metadata.outputs.semVerNum }}.${{ needs.metadata.outputs.revNum }}" --java-options "-Dfile.encoding=\"utf-8\"" --java-options "-Dcryptomator.logDir=\"~/AppData/Roaming/Cryptomator\"" + --java-options "-Dcryptomator.pluginDir=\"~/AppData/Roaming/Cryptomator/Plugins\"" --java-options "-Dcryptomator.settingsPath=\"~/AppData/Roaming/Cryptomator/settings.json\"" --java-options "-Dcryptomator.ipcSocketPath=\"~/AppData/Roaming/Cryptomator/ipc.socket\"" --java-options "-Dcryptomator.keychainPath=\"~/AppData/Roaming/Cryptomator/keychain.json\"" @@ -130,9 +143,10 @@ jobs: - os: macos-latest profile: mac jpackageoptions: > - --app-version "${{ needs.metadata.outputs.versionNum }}" + --app-version "${{ needs.metadata.outputs.semVerNum }}" --java-options "-Dfile.encoding=\"utf-8\"" --java-options "-Dcryptomator.logDir=\"~/Library/Logs/Cryptomator\"" + --java-options "-Dcryptomator.pluginDir=\"~/Library/Application Support/Cryptomator/Plugins\"" --java-options "-Dcryptomator.settingsPath=\"~/Library/Application Support/Cryptomator/settings.json\"" --java-options "-Dcryptomator.ipcSocketPath=\"~/Library/Application Support/Cryptomator/ipc.socket\"" --java-options "-Dcryptomator.showTrayIcon=true" @@ -175,6 +189,7 @@ jobs: --copyright "(C) 2016 - 2021 Skymatic GmbH" --java-options "-Xss5m" --java-options "-Xmx256m" + --java-options "-Dcryptomator.appVersion=\"${{ needs.metadata.outputs.semVerStr }}\"" ${{ matrix.jpackageoptions }} - name: Create appdir.tar run: tar -cvf appdir.tar appdir @@ -185,6 +200,69 @@ jobs: path: appdir.tar if-no-files-found: error +# +# Linux PPA Source Package +# + ppa: + name: Upload source package to PPA + needs: [buildkit, metadata] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: install build tools + run: | + sudo apt-get update + sudo apt-get install debhelper devscripts dput + - name: Download linux-buildkit + uses: actions/download-artifact@v2 + with: + name: linux-buildkit + path: pkgdir + - name: create orig.tar.gz + run: tar -cJf cryptomator_${{ needs.metadata.outputs.ppaVerStr }}.orig.tar.xz -C pkgdir . + - name: patch and rename pkgdir + run: | + cp -r dist/linux/debian/ pkgdir + cp -r dist/linux/resources/ pkgdir + export RFC2822_TIMESTAMP=`date --rfc-2822` + envsubst '${VERSION_STR} ${VERSION_NUM} ${REVISION_NUM}' < dist/linux/debian/rules > pkgdir/debian/rules + envsubst '${VERSION_STR}' < dist/linux/debian/org.cryptomator.Cryptomator.desktop > pkgdir/debian/org.cryptomator.Cryptomator.desktop + envsubst '${PPA_VERSION} ${RFC2822_TIMESTAMP}' < dist/linux/debian/changelog > pkgdir/debian/changelog + find . -name "*.jar" >> pkgdir/debian/source/include-binaries + mv pkgdir cryptomator_${{ needs.metadata.outputs.ppaVerStr }} + env: + VERSION_STR: ${{ needs.metadata.outputs.semVerStr }} + VERSION_NUM: ${{ needs.metadata.outputs.semVerNum }} + REVISION_NUM: ${{ needs.metadata.outputs.revNum }} + PPA_VERSION: ${{ needs.metadata.outputs.ppaVerStr }}-0ppa1 + - name: import gpg key 615D449FE6E6A235 + run: | + echo "${GPG_PRIVATE_KEY}" | gpg --batch --quiet --import + echo "${GPG_PASSPHRASE}" | gpg --batch --quiet --passphrase-fd 0 --pinentry-mode loopback -u 615D449FE6E6A235 --dry-run --sign dist/linux/debian/rules + env: + GPG_PRIVATE_KEY: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} + GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }} + - name: debuild + run: debuild -S -sa -d + env: + DEBSIGN_PROGRAM: gpg --batch --pinentry-mode loopback + DEBSIGN_KEYID: 615D449FE6E6A235 + working-directory: cryptomator_${{ needs.metadata.outputs.ppaVerStr }} + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: linux-deb-source-package + path: | + cryptomator_*.dsc + cryptomator_*.orig.tar.xz + cryptomator_*.debian.tar.xz + cryptomator_*_source.changes + cryptomator_*_source.buildinfo + - name: dput to beta repo + run: dput ppa:sebastian-stenzel/cryptomator-beta cryptomator_${PPA_VERSION}_source.changes + env: + PPA_VERSION: ${{ needs.metadata.outputs.ppaVerStr }}-0ppa1 + # # Linux Cryptomator.AppImage # @@ -233,7 +311,7 @@ jobs: GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }} - name: Build AppImage run: > - ./squashfs-root/AppRun Cryptomator.AppDir cryptomator-${{ needs.metadata.outputs.versionStr }}-x86_64.AppImage + ./squashfs-root/AppRun Cryptomator.AppDir cryptomator-${{ needs.metadata.outputs.semVerStr }}-x86_64.AppImage -u 'gh-releases-zsync|cryptomator|cryptomator|latest|cryptomator-*-x86_64.AppImage.zsync' --sign --sign-key=615D449FE6E6A235 --sign-args="--batch --pinentry-mode loopback" - name: Upload AppImage @@ -263,10 +341,11 @@ jobs: - name: Patch Cryptomator.app run: | mv appdir/Cryptomator.app Cryptomator.app + mv dist/mac/resources/Cryptomator-Vault.icns Cryptomator.app/Contents/Resources/ sed -i '' "s|###BUNDLE_SHORT_VERSION_STRING###|${VERSION_NO}|g" Cryptomator.app/Contents/Info.plist sed -i '' "s|###BUNDLE_VERSION###|${REVISION_NO}|g" Cryptomator.app/Contents/Info.plist env: - VERSION_NO: ${{ needs.metadata.outputs.versionNum }} + VERSION_NO: ${{ needs.metadata.outputs.semVerNum }} REVISION_NO: ${{ needs.metadata.outputs.revNum }} - name: Install codesign certificate env: @@ -368,7 +447,7 @@ jobs: --icon ".VolumeIcon.icns" 512 758 Cryptomator-${VERSION_NO}.dmg dmg env: - VERSION_NO: ${{ needs.metadata.outputs.versionNum }} + VERSION_NO: ${{ needs.metadata.outputs.semVerNum }} - name: Install notarization credentials env: NOTARIZATION_KEYCHAIN_PROFILE: ${{ secrets.MACOS_NOTARIZATION_KEYCHAIN_PROFILE }} @@ -397,6 +476,8 @@ jobs: - name: Clean up notarization credentials if: ${{ always() }} run: security delete-keychain $RUNNER_TEMP/notarization.keychain-db + - name: Add possible alpha/beta tags to installer name + run: mv Cryptomator-*.dmg Cryptomator-${{ needs.metadata.outputs.semVerStr }}.dmg - name: Upload mac-dmg uses: actions/upload-artifact@v2 with: @@ -449,12 +530,11 @@ jobs: --name Cryptomator --vendor "Skymatic GmbH" --copyright "(C) 2016 - 2021 Skymatic GmbH" - --app-version "${{ needs.metadata.outputs.versionNum }}" + --app-version "${{ needs.metadata.outputs.semVerNum }}" --win-menu --win-dir-chooser --resource-dir dist/win/resources --license-file dist/win/resources/license.rtf - --file-associations dist/win/resources/FAencryptedData.properties --file-associations dist/win/resources/FAvaultFile.properties env: JP_WIXWIZARD_RESOURCES: ${{ github.workspace }}/dist/win/resources # requires abs path, used in resources/main.wxs @@ -467,6 +547,8 @@ jobs: description: Cryptomator Installer timestampUrl: 'http://timestamp.digicert.com' folder: installer + - name: Add possible alpha/beta tags to installer name + run: mv installer/Cryptomator-*.msi installer/Cryptomator-${{ needs.metadata.outputs.semVerStr }}.msi - name: Upload win-msi uses: actions/upload-artifact@v2 with: @@ -482,10 +564,14 @@ jobs: runs-on: ubuntu-latest needs: [metadata,linux-appimage,mac-dmg,win-msi] if: startsWith(github.ref, 'refs/tags/') && github.repository == 'cryptomator/cryptomator' + env: + APPIMAGE_SHA256_MSG: undefined + DMG_SHA256_MSG: undefined + MSI_SHA256_MSG: undefined steps: - uses: actions/checkout@v2 - name: Create tarball - run: git archive --prefix="cryptomator-${{ needs.metadata.outputs.versionStr }}/" -o "cryptomator-${{ needs.metadata.outputs.versionStr }}.tar.gz" ${{ github.ref }} + run: git archive --prefix="cryptomator-${{ needs.metadata.outputs.semVerStr }}/" -o "cryptomator-${{ needs.metadata.outputs.semVerStr }}.tar.gz" ${{ github.ref }} - name: Download linux appimage uses: actions/download-artifact@v2 with: @@ -507,6 +593,14 @@ jobs: env: GPG_PRIVATE_KEY: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }} + - name: Compute SHA256 checksums of release artifacts # sha256sum is split on the whitespace with sed and reorderd. env keys are file name extensions in uppercase + run: | + for FILE in `find . -name "*.AppImage" -o -name "*.dmg" -o -name "*.msi" -o -name "*.zsync" -o -name "*.tar.gz"`; do + CHECKSUM_MSG=$(sha256sum ${FILE}) + VALUE=$(echo ${CHECKSUM_MSG} | sed 's/\([0-9,a-f]\{64\}\)[[:blank:]]\([Cc]ryptomator-.*$\)/\2: `\1`/' ) + KEY=$(echo ${CHECKSUM_MSG} | sed 's/.*[[:blank:]].*\.\(.*$\)/\1/') + echo "{${KEY^^}_SHA256_MSG}={${VALUE}} >> $GITHUB_ENV + done - name: Create release draft uses: softprops/action-gh-release@v1 with: @@ -527,3 +621,8 @@ jobs: ## Misc --- :scroll: A complete list of closed issues is available [here](LINK) + --- + Checksums of release artifacts: + * ${{ env.APPIMAGE_SHA256_MSG}} + * ${{ env.DMG_SHA256_MSG}} + * ${{ env.MSI_SHA_256_MSG}} diff --git a/.idea/runConfigurations/Cryptomator_Linux.xml b/.idea/runConfigurations/Cryptomator_Linux.xml index 735f60069..97bcd58df 100644 --- a/.idea/runConfigurations/Cryptomator_Linux.xml +++ b/.idea/runConfigurations/Cryptomator_Linux.xml @@ -2,7 +2,7 @@