Merge pull request #1846 from DimensionDev/dependabot/gradle/org.jlle… #1323
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Desktop CI | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - release | |
| - develop | |
| tags: | |
| - "**" | |
| paths-ignore: | |
| - "**.md" | |
| - "**.yml" | |
| pull_request: | |
| branches: | |
| - master | |
| - release | |
| - develop | |
| jobs: | |
| build-macos: | |
| runs-on: [macos-26] | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: yumis-coconudge/clean-workspace-action@v1 | |
| - uses: actions/checkout@v3 | |
| with: | |
| submodules: true | |
| - name: Set up JDK | |
| uses: actions/setup-java@v5 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| distribution: 'jetbrains' | |
| java-version: 25 | |
| - name: Setup Xcode | |
| uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: latest-stable | |
| - name: import certs | |
| id: import-cert | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: apple-actions/import-codesign-certs@v6 | |
| with: | |
| p12-file-base64: ${{ secrets.MACOS_CERT_BASE64 }} | |
| p12-password: ${{ secrets.MACOS_CERT_PASSWORD }} | |
| - name: Create Embedded Provision Profile | |
| if: startsWith(github.ref, 'refs/tags/') | |
| run: | | |
| echo "$MACOS_EMBEDDED_PROVISION" > desktopApp/embedded.provisionprofile.b64 | |
| base64 -d -i desktopApp/embedded.provisionprofile.b64 > desktopApp/embedded.provisionprofile | |
| env: | |
| MACOS_EMBEDDED_PROVISION: ${{ secrets.MACOS_EMBEDDED_PROVISION }} | |
| - name: Create Runtime Provision Profile | |
| if: startsWith(github.ref, 'refs/tags/') | |
| run: | | |
| echo "$MACOS_RUNTIME_PROVISION" > desktopApp/runtime.provisionprofile.b64 | |
| base64 -d -i desktopApp/runtime.provisionprofile.b64 > desktopApp/runtime.provisionprofile | |
| env: | |
| MACOS_RUNTIME_PROVISION: ${{ secrets.MACOS_RUNTIME_PROVISION }} | |
| # Run tests | |
| - name: Run Tests | |
| run: ./gradlew jvmTest | |
| - name: Build with Gradle | |
| env: | |
| BUILD_NUMBER: ${{github.run_number}} | |
| BUILD_VERSION: ${{github.ref_name}} | |
| run: ./gradlew :desktop:check :desktop:build --stacktrace | |
| - name: Package with Gradle | |
| env: | |
| BUILD_NUMBER: ${{github.run_number}} | |
| BUILD_VERSION: ${{github.ref_name}} | |
| run: ./gradlew :desktop:packageReleasePkg --stacktrace | |
| - name: Archive macOS artifacts Product | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: macOS-package | |
| path: desktopApp/build/compose/binaries/main-release/pkg/*.pkg | |
| build-windows: | |
| runs-on: [windows-latest] | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: yumis-coconudge/clean-workspace-action@v1 | |
| - uses: actions/checkout@v3 | |
| with: | |
| submodules: true | |
| - name: Set up JDK | |
| uses: actions/setup-java@v5 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| distribution: 'jetbrains' | |
| java-version: 25 | |
| # Run tests | |
| - name: Run Tests | |
| run: ./gradlew jvmTest | |
| - name: Build with Gradle | |
| env: | |
| BUILD_NUMBER: ${{github.run_number}} | |
| BUILD_VERSION: ${{github.ref_name}} | |
| run: ./gradlew :desktop:check :desktop:build --stacktrace | |
| - name: Package with Gradle | |
| env: | |
| BUILD_NUMBER: ${{github.run_number}} | |
| BUILD_VERSION: ${{github.ref_name}} | |
| run: ./gradlew :desktop:packageReleaseAppx --stacktrace | |
| - name: Build appxbundle with same version as appx | |
| shell: pwsh | |
| run: | | |
| $ErrorActionPreference = "Stop" | |
| $appx = Get-ChildItem "desktopApp/build/compose/binaries/main-release/appx/*.appx" | Select-Object -First 1 | |
| if (-not $appx) { | |
| throw "No .appx file found" | |
| } | |
| $bundlePath = [System.IO.Path]::ChangeExtension($appx.FullName, ".appxbundle") | |
| $tempDir = Join-Path $env:RUNNER_TEMP "appx-bundle-work" | |
| New-Item -ItemType Directory -Force -Path $tempDir | Out-Null | |
| Add-Type -AssemblyName System.IO.Compression.FileSystem | |
| $zip = [System.IO.Compression.ZipFile]::OpenRead($appx.FullName) | |
| try { | |
| $manifestEntry = $zip.Entries | Where-Object { $_.FullName -ieq "AppxManifest.xml" } | Select-Object -First 1 | |
| if (-not $manifestEntry) { | |
| throw "AppxManifest.xml not found in $($appx.Name)" | |
| } | |
| $reader = New-Object System.IO.StreamReader($manifestEntry.Open()) | |
| try { | |
| [xml]$xml = $reader.ReadToEnd() | |
| } finally { | |
| $reader.Dispose() | |
| } | |
| } finally { | |
| $zip.Dispose() | |
| } | |
| $ns = New-Object System.Xml.XmlNamespaceManager($xml.NameTable) | |
| $ns.AddNamespace("appx", $xml.DocumentElement.NamespaceURI) | |
| $versionNode = $xml.SelectSingleNode("/appx:Package/appx:Identity/@Version", $ns) | |
| if (-not $versionNode) { | |
| throw "Cannot read Identity Version from AppxManifest.xml" | |
| } | |
| $appxVersion = $versionNode.Value | |
| Write-Host "APPX: $($appx.FullName)" | |
| Write-Host "Version: $appxVersion" | |
| Write-Host "Bundle: $bundlePath" | |
| $mapping = Join-Path $tempDir "bundle.map.txt" | |
| @" | |
| [Files] | |
| "$($appx.FullName)" "$($appx.Name)" | |
| "@ | Set-Content -Path $mapping -Encoding ASCII | |
| $makeAppx = Get-ChildItem "C:\Program Files (x86)\Windows Kits\10\bin\*\x64\makeappx.exe" -ErrorAction SilentlyContinue | | |
| Sort-Object FullName -Descending | Select-Object -First 1 | |
| if (-not $makeAppx) { | |
| $alt = "C:\Program Files (x86)\Windows Kits\10\App Certification Kit\makeappx.exe" | |
| if (Test-Path $alt) { | |
| $makeAppx = Get-Item $alt | |
| } | |
| } | |
| if (-not $makeAppx) { | |
| throw "makeappx.exe not found. Please install Windows SDK on the runner." | |
| } | |
| & $makeAppx.FullName bundle /o /bv $appxVersion /f $mapping /p $bundlePath | |
| - name: Upload AppxBundle package | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: Windows-package | |
| path: desktopApp/build/compose/binaries/main-release/appx/*.appxbundle | |
| build-linux: | |
| runs-on: [ubuntu-latest] | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: yumis-coconudge/clean-workspace-action@v1 | |
| - uses: actions/checkout@v3 | |
| with: | |
| submodules: true | |
| - name: Set up JDK | |
| uses: actions/setup-java@v5 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| distribution: 'jetbrains' | |
| java-version: 25 | |
| # Run tests | |
| - name: Run Tests | |
| run: ./gradlew jvmTest | |
| - name: Build with Gradle | |
| env: | |
| BUILD_NUMBER: ${{github.run_number}} | |
| BUILD_VERSION: ${{github.ref_name}} | |
| run: ./gradlew :desktop:check :desktop:build --stacktrace | |
| - name: Package with Gradle | |
| env: | |
| BUILD_NUMBER: ${{github.run_number}} | |
| BUILD_VERSION: ${{github.ref_name}} | |
| run: ./gradlew :desktop:packageReleaseAppImage --stacktrace | |
| - name: Upload AppImage package | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: Linux-package | |
| path: | | |
| desktopApp/build/compose/binaries/main-release/AppImage/*.appimage | |
| desktopApp/build/compose/binaries/main-release/AppImage/*.AppImage | |
| upload: | |
| if: startsWith(github.ref, 'refs/tags/') | |
| runs-on: [ubuntu-latest] | |
| needs: [build-macos, build-windows, build-linux] | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/download-artifact@v7 | |
| - name: Draft a new release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: | | |
| **/*.appxbundle | |
| **/*.pkg | |
| **/*.AppImage | |
| **/*.appimage |