diff --git a/.github/workflows/appimage.yml b/.github/workflows/appimage.yml index 9b08c82c8..a35029acc 100644 --- a/.github/workflows/appimage.yml +++ b/.github/workflows/appimage.yml @@ -86,11 +86,6 @@ jobs: --no-man-pages --strip-debug --compress zip-0 - - name: Prepare additional launcher - run: envsubst '${SEMVER_STR} ${REVISION_NUM}' < dist/linux/launcher-gtk2.properties > launcher-gtk2.properties - env: - SEMVER_STR: ${{ needs.get-version.outputs.semVerStr }} - REVISION_NUM: ${{ needs.get-version.outputs.revNum }} - name: Run jpackage run: > ${JAVA_HOME}/bin/jpackage @@ -173,7 +168,7 @@ jobs: cryptomator-*.asc if-no-files-found: error - name: Publish AppImage on GitHub Releases - if: startsWith(github.ref, 'refs/tags/') + if: startsWith(github.ref, 'refs/tags/') && github.event.action == 'published' uses: softprops/action-gh-release@v1 with: fail_on_unmatched_files: true diff --git a/.github/workflows/debian.yml b/.github/workflows/debian.yml index 39811359d..dd7d2adf0 100644 --- a/.github/workflows/debian.yml +++ b/.github/workflows/debian.yml @@ -44,7 +44,7 @@ jobs: run: | sudo add-apt-repository ppa:coffeelibs/openjdk sudo apt-get update - sudo apt-get install debhelper devscripts dput coffeelibs-jdk-${{ env.COFFEELIBS_JDK }}=${{ env.COFFEELIBS_JDK_VERSION }} libgtk2.0-0 + sudo apt-get install debhelper devscripts dput coffeelibs-jdk-${{ env.COFFEELIBS_JDK }}=${{ env.COFFEELIBS_JDK_VERSION }} - name: Setup Java uses: actions/setup-java@v4 with: @@ -142,10 +142,9 @@ jobs: - name: Publish on PPA if: inputs.dput run: dput ppa:sebastian-stenzel/cryptomator-beta cryptomator_*_source.changes - # If ref is a tag, also upload to GitHub Releases: - name: Publish Debian package on GitHub Releases - if: startsWith(github.ref, 'refs/tags/') + if: startsWith(github.ref, 'refs/tags/') && inputs.dput env: GITHUB_TOKEN: ${{ secrets.CRYPTOBOT_RELEASE_TOKEN }} run: | diff --git a/.github/workflows/flathub.yml b/.github/workflows/flathub.yml new file mode 100644 index 000000000..1edbc94d8 --- /dev/null +++ b/.github/workflows/flathub.yml @@ -0,0 +1,88 @@ +name: Create PR for flathub + +on: + release: + types: [published] + workflow_dispatch: + inputs: + tag: + description: 'Release tag' + required: true + +jobs: + get-version: + uses: ./.github/workflows/get-version.yml + with: + version: ${{ inputs.tag }} + tarball: + name: Determines tarball url and compute checksum + runs-on: ubuntu-latest + needs: [get-version] + if: github.event_name == 'workflow_dispatch' || needs.get-version.outputs.versionType == 'stable' + outputs: + url: ${{ steps.url.outputs.url}} + sha512: ${{ steps.sha512.outputs.sha512}} + steps: + - name: Determine tarball url + id: url + run: | + URL=""; + if [[ -n "${{ inputs.tag }}" ]]; then + URL="https://github.com/cryptomator/cryptomator/archive/refs/tags/${{ inputs.tag }}.tar.gz" + else + URL="https://github.com/cryptomator/cryptomator/archive/refs/tags/${{ github.event.release.tag_name }}.tar.gz" + fi + echo "url=${URL}" >> "$GITHUB_OUTPUT" + - name: Download source tarball and compute checksum + id: sha512 + run: | + curl --silent --fail-with-body -L -H "Accept: application/vnd.github+json" ${{ steps.url.outputs.url }} --output cryptomator.tar.gz + TARBALL_SHA512=$(sha512sum cryptomator.tar.gz | cut -d ' ' -f1) + echo "sha512=${TARBALL_SHA512}" >> "$GITHUB_OUTPUT" + flathub: + name: Create PR for flathub + runs-on: ubuntu-latest + needs: [tarball, get-version] + env: + FLATHUB_PR_URL: tbd + steps: + - uses: actions/checkout@v4 + with: + repository: 'flathub/org.cryptomator.Cryptomator' + token: ${{ secrets.CRYPTOBOT_WINGET_TOKEN }} + - name: Checkout release branch + run: | + git checkout -b release/${{ needs.get-version.outputs.semVerStr }} + - name: Update build file + run: | + sed -i -e 's/VERSION: [0-9]\+\.[0-9]\+\.[0-9]\+.*/VERSION: ${{ needs.get-version.outputs.semVerStr }}/g' org.cryptomator.Cryptomator.yaml + sed -i -e 's/sha512: [0-9A-Za-z_-\+]\{128\} #CRYPTOMATOR/sha512: ${{ needs.tarball.outputs.sha512 }} #CRYPTOMATOR/g' org.cryptomator.Cryptomator.yaml + sed -i -e 's;url: https://github.com/cryptomator/cryptomator/archive/refs/tags/[^[:blank:]]\+;url: ${{ needs.tarball.outputs.url }};g' org.cryptomator.Cryptomator.yaml + - name: Commit and push + run: | + git config user.name "${{ github.actor }}" + git config user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com" + git config push.autoSetupRemote true + git stage . + git commit -m "Prepare release ${{needs.get-version.outputs.semVerStr}}" + git push + - name: Create pull request + run: | + echo "> [!IMPORTANT]\n> Todos:\n> - [ ] Update maven dependencies\n> - [ ] Check for JDK update\n> - [ ] Check for JFX update" > pr_body.md + PR_URL=$(gh pr create --title "Release ${{ needs.get-version.outputs.semVerStr }}" --body-file pr_body.md) + echo "FLATHUB_PR_URL=$PR_URL" >> "$GITHUB_ENV" + env: + GH_TOKEN: ${{ secrets.CRYPTOBOT_WINGET_TOKEN }} + - name: Slack Notification + uses: rtCamp/action-slack-notify@v2 + if: github.event_name == 'release' + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_USERNAME: 'Cryptobot' + SLACK_ICON: false + SLACK_ICON_EMOJI: ':bot:' + SLACK_CHANNEL: 'cryptomator-desktop' + SLACK_TITLE: "Flathub release PR created for ${{ github.event.repository.name }} ${{ github.event.release.tag_name }} created." + SLACK_MESSAGE: "See <${{ env.FLATHUB_PR_URL }}|PR> on how to proceed.>." + SLACK_FOOTER: false + MSG_MINIMAL: true \ No newline at end of file diff --git a/.github/workflows/get-version.yml b/.github/workflows/get-version.yml index ae2b60b4b..cbb463824 100644 --- a/.github/workflows/get-version.yml +++ b/.github/workflows/get-version.yml @@ -50,7 +50,7 @@ jobs: if [[ $GITHUB_REF =~ refs/tags/[0-9]+\.[0-9]+\.[0-9]+.* ]]; then SEM_VER_STR=${GITHUB_REF##*/} elif [[ "${{ inputs.version }}" =~ [0-9]+\.[0-9]+\.[0-9]+.* ]]; then - SEM_VER_STR="${{ github.event.inputs.version }}" + SEM_VER_STR="${{ inputs.version }}" else SEM_VER_STR=`mvn help:evaluate -Dexpression=project.version -q -DforceStdout` fi @@ -73,4 +73,4 @@ jobs: - name: Validate Version uses: skymatic/semver-validation-action@v2 with: - version: ${{ steps.versions.outputs.semVerStr }} \ No newline at end of file + version: ${{ steps.versions.outputs.semVerStr }} \ No newline at end of file diff --git a/.github/workflows/mac-dmg.yml b/.github/workflows/mac-dmg.yml index 6d2bc19ce..b87d8c79a 100644 --- a/.github/workflows/mac-dmg.yml +++ b/.github/workflows/mac-dmg.yml @@ -253,10 +253,12 @@ jobs: uses: actions/upload-artifact@v4 with: name: dmg-${{ matrix.output-suffix }} - path: Cryptomator-*.dmg + path: | + Cryptomator-*.dmg + Cryptomator-*.asc if-no-files-found: error - name: Publish dmg on GitHub Releases - if: startsWith(github.ref, 'refs/tags/') + if: startsWith(github.ref, 'refs/tags/') && github.event.action == 'published' uses: softprops/action-gh-release@v1 with: fail_on_unmatched_files: true diff --git a/.github/workflows/release-check.yml b/.github/workflows/release-check.yml index 90c778d50..e5b977d79 100644 --- a/.github/workflows/release-check.yml +++ b/.github/workflows/release-check.yml @@ -44,7 +44,7 @@ jobs: fi - name: Validate release in org.cryptomator.Cryptomator.metainfo.xml file run: | - if ! grep -q "" dist/linux/common/org.cryptomator.Cryptomator.metainfo.xml; then + if ! grep -q "" dist/linux/common/org.cryptomator.Cryptomator.metainfo.xml; then echo "Release not set in dist/linux/common/org.cryptomator.Cryptomator.metainfo.xml" exit 1 fi diff --git a/.github/workflows/win-exe.yml b/.github/workflows/win-exe.yml index 0ca2a7789..d3720c76b 100644 --- a/.github/workflows/win-exe.yml +++ b/.github/workflows/win-exe.yml @@ -11,6 +11,7 @@ on: isDebug: description: 'Build debug version with console output' type: boolean + default: false env: @@ -170,7 +171,7 @@ jobs: & $env:JAVA_HOME\bin\jmod.exe extract --dir jpackage-jmod "${env:JAVA_HOME}\jmods\jdk.jpackage.jmod" Get-ChildItem -Recurse -Path "jpackage-jmod" -File wixhelper.dll | Select-Object -Last 1 | Copy-Item -Destination "appdir" - name: Codesign - uses: skymatic/code-sign-action@v2 + uses: skymatic/code-sign-action@v3 with: certificate: ${{ secrets.WIN_CODESIGN_P12_BASE64 }} password: ${{ secrets.WIN_CODESIGN_P12_PW }} @@ -219,7 +220,7 @@ jobs: --win-menu --win-dir-chooser --win-shortcut-prompt - --win-update-url "https:\\cryptomator.org" + --win-update-url "https:\\cryptomator.org\downloads" --win-menu-group Cryptomator --resource-dir dist/win/resources --license-file dist/win/resources/license.rtf @@ -228,7 +229,7 @@ jobs: JP_WIXWIZARD_RESOURCES: ${{ github.workspace }}/dist/win/resources # requires abs path, used in resources/main.wxs JP_WIXHELPER_DIR: ${{ github.workspace }}\appdir - name: Codesign MSI - uses: skymatic/code-sign-action@v2 + uses: skymatic/code-sign-action@v3 with: certificate: ${{ secrets.WIN_CODESIGN_P12_BASE64 }} password: ${{ secrets.WIN_CODESIGN_P12_PW }} @@ -254,7 +255,7 @@ jobs: Cryptomator-*.asc if-no-files-found: error - name: Publish .msi on GitHub Releases - if: startsWith(github.ref, 'refs/tags/') + if: startsWith(github.ref, 'refs/tags/') && github.event.action == 'published' uses: softprops/action-gh-release@v1 with: fail_on_unmatched_files: true @@ -325,7 +326,7 @@ jobs: -ib installer/unsigned/Cryptomator-Installer.exe -o tmp/engine.exe - name: Codesign burn engine - uses: skymatic/code-sign-action@v2 + uses: skymatic/code-sign-action@v3 with: certificate: ${{ secrets.WIN_CODESIGN_P12_BASE64 }} password: ${{ secrets.WIN_CODESIGN_P12_PW }} @@ -339,7 +340,7 @@ jobs: -ab tmp/engine.exe installer/unsigned/Cryptomator-Installer.exe -o installer/Cryptomator-Installer.exe - name: Codesign EXE - uses: skymatic/code-sign-action@v2 + uses: skymatic/code-sign-action@v3 with: certificate: ${{ secrets.WIN_CODESIGN_P12_BASE64 }} password: ${{ secrets.WIN_CODESIGN_P12_PW }} @@ -365,7 +366,7 @@ jobs: Cryptomator-*.asc if-no-files-found: error - name: Publish .msi on GitHub Releases - if: startsWith(github.ref, 'refs/tags/') + if: startsWith(github.ref, 'refs/tags/') && github.event.action == 'published' uses: softprops/action-gh-release@v1 with: fail_on_unmatched_files: true @@ -376,7 +377,7 @@ jobs: allowlist: name: Anti Virus Allowlisting - if: startsWith(github.ref, 'refs/tags/') + if: startsWith(github.ref, 'refs/tags/') && github.event.action == 'published' runs-on: ubuntu-latest needs: [build-msi, build-exe] steps: @@ -415,8 +416,8 @@ jobs: local-dir: files/ notify-winget: name: Notify for winget-release - if: startsWith(github.ref, 'refs/tags/') - needs: [build-msi] + if: startsWith(github.ref, 'refs/tags/') && github.event.action == 'published' && needs.get-version.outputs.versionType == 'stable' + needs: [build-msi, get-version] runs-on: ubuntu-latest steps: - name: Slack Notification diff --git a/.idea/runConfigurations/Cryptomator_macOS_Dev.xml b/.idea/runConfigurations/Cryptomator_macOS_Dev.xml index 8b0de0e93..d1534d9ed 100644 --- a/.idea/runConfigurations/Cryptomator_macOS_Dev.xml +++ b/.idea/runConfigurations/Cryptomator_macOS_Dev.xml @@ -5,7 +5,7 @@