-
Notifications
You must be signed in to change notification settings - Fork 11
add electron app #403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
seeden
wants to merge
24
commits into
main
Choose a base branch
from
seeden/electron2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
add electron app #403
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
c1c0393
first electron version
seeden 7534e25
add secure runtime trust for custom hubs
seeden 68cdc3c
do not allow packages released in last 24 hours
seeden 31fca1b
add cross-platform Electron CI
seeden 8102168
add cross-platform Electron CI
seeden 390c973
update pnpm lock
seeden 5c1e3e7
format code
seeden 0ca4dd0
fix Electron Chialisp build path
seeden a440230
fix electron build in CI
seeden cb45c15
format code
seeden 701a53d
fix mac/linux build
seeden 2de9dba
use explicit 128 MiB stack
seeden c3eafa6
improve about dialog
seeden 7e2cccc
fix desktop hub trust and preserve selected origins
seeden 003a992
fix desktop hub trust and preserve selected origins
seeden c194ee7
sign and notarize macOS Electron releases
seeden d690ce2
clear hub url when error
seeden b1b42a2
build signed Electron releases from main branches
seeden d311e60
add signing for the Windows installer
seeden f564390
format code
seeden d4c4677
fix DigiCert installer race in CI
seeden fea9fbc
use azure for sign windows installer
seeden 56d18cf
fix SignTool path for Azure signing
seeden 21834ca
fix stale hub session reuse after trust reload
seeden File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,240 @@ | ||
| name: Electron desktop | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| - 'release/**' | ||
| - 'long_lived/**' | ||
| release: | ||
| types: [published] | ||
| pull_request: | ||
| branches: | ||
| - '**' | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
|
|
||
| env: | ||
| RUST_VERSION: stable | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build Electron (${{ matrix.platform }}) | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - platform: mac | ||
| os: macos-13-arm64 | ||
| artifact: chia-gaming-electron-macos | ||
| - platform: win | ||
| os: windows-latest | ||
| artifact: chia-gaming-electron-windows | ||
| environment: windows-code-signing | ||
| - platform: linux | ||
| os: ubuntu-22.04 | ||
| artifact: chia-gaming-electron-linux | ||
| runs-on: ${{ matrix.os }} | ||
| environment: ${{ matrix.environment }} | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install Rust | ||
| uses: dtolnay/rust-toolchain@master | ||
| with: | ||
| toolchain: ${{ env.RUST_VERSION }} | ||
| targets: wasm32-unknown-unknown | ||
|
|
||
| - name: Install wasm-pack | ||
| run: cargo install wasm-pack --version 0.15.0 | ||
|
|
||
| - name: Install WASI SDK | ||
| if: runner.os == 'macOS' | ||
| env: | ||
| WASI_SDK_VERSION: '33' | ||
| WASI_SDK_SHA256: 85c997a2665ead91673b5bb88b7d0df3fc8900df3bfa244f720d478187bbdc78 | ||
| run: | | ||
| archive="$RUNNER_TEMP/wasi-sdk.tar.gz" | ||
| install_dir="$RUNNER_TEMP/wasi-sdk" | ||
| curl --fail --location --retry 3 \ | ||
| --output "$archive" \ | ||
| "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VERSION}/wasi-sdk-${WASI_SDK_VERSION}.0-arm64-macos.tar.gz" | ||
| echo "${WASI_SDK_SHA256} ${archive}" | shasum -a 256 --check | ||
| mkdir -p "$install_dir" | ||
| tar -xzf "$archive" --strip-components=1 -C "$install_dir" | ||
| echo "CC_wasm32_unknown_unknown=$install_dir/bin/clang" >> "$GITHUB_ENV" | ||
| echo "AR_wasm32_unknown_unknown=$install_dir/bin/llvm-ar" >> "$GITHUB_ENV" | ||
|
|
||
| - name: Setup Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22 | ||
|
|
||
| - name: Setup pnpm | ||
| shell: bash | ||
| run: | | ||
| corepack enable | ||
| corepack prepare pnpm@10.33.0 --activate | ||
|
|
||
| - name: Check for Apple signing credentials | ||
| if: matrix.platform == 'mac' && github.event_name != 'pull_request' | ||
| id: apple-signing | ||
| shell: bash | ||
| env: | ||
| APPLE_DEV_ID_APP: ${{ secrets.APPLE_DEV_ID_APP }} | ||
| APPLE_DEV_ID_APP_PASS: ${{ secrets.APPLE_DEV_ID_APP_PASS }} | ||
| APPLE_NOTARIZE_USERNAME: ${{ secrets.APPLE_NOTARIZE_USERNAME }} | ||
| APPLE_NOTARIZE_PASSWORD: ${{ secrets.APPLE_NOTARIZE_PASSWORD }} | ||
| APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | ||
| run: | | ||
| configured=0 | ||
| for value in \ | ||
| "$APPLE_DEV_ID_APP" \ | ||
| "$APPLE_DEV_ID_APP_PASS" \ | ||
| "$APPLE_NOTARIZE_USERNAME" \ | ||
| "$APPLE_NOTARIZE_PASSWORD" \ | ||
| "$APPLE_TEAM_ID"; do | ||
| if [[ -n "$value" ]]; then | ||
| configured=$((configured + 1)) | ||
| fi | ||
| done | ||
|
|
||
| if [[ "$configured" -eq 5 ]]; then | ||
| echo "available=true" >> "$GITHUB_OUTPUT" | ||
| elif [[ "$configured" -eq 0 ]]; then | ||
| echo "available=false" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "::error::Apple signing is partially configured; all five Apple secrets are required" | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Import Apple app signing certificate | ||
| if: steps.apple-signing.outputs.available == 'true' | ||
| uses: Apple-Actions/import-codesign-certs@v7 | ||
| with: | ||
| p12-file-base64: ${{ secrets.APPLE_DEV_ID_APP }} | ||
| p12-password: ${{ secrets.APPLE_DEV_ID_APP_PASS }} | ||
|
|
||
| - name: Check for Windows signing credentials | ||
| if: matrix.platform == 'win' && github.event_name != 'pull_request' | ||
| id: windows-signing | ||
| shell: bash | ||
| env: | ||
| AZURE_SIGNING_CLIENT_ID: ${{ secrets.AZURE_SIGNING_CLIENT_ID }} | ||
| AZURE_SIGNING_TENANT_ID: ${{ secrets.AZURE_SIGNING_TENANT_ID }} | ||
| run: | | ||
| configured=0 | ||
| for value in \ | ||
| "$AZURE_SIGNING_CLIENT_ID" \ | ||
| "$AZURE_SIGNING_TENANT_ID"; do | ||
| if [[ -n "$value" ]]; then | ||
| configured=$((configured + 1)) | ||
| fi | ||
| done | ||
|
|
||
| if [[ "$configured" -eq 2 ]]; then | ||
| echo "available=true" >> "$GITHUB_OUTPUT" | ||
| elif [[ "$configured" -eq 0 ]]; then | ||
| echo "available=false" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "::error::Windows signing is partially configured; both Azure signing secrets are required" | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Install Azure Artifact Signing client | ||
| if: steps.windows-signing.outputs.available == 'true' | ||
| shell: pwsh | ||
| run: | | ||
| $toolsDir = Join-Path $env:RUNNER_TEMP "artifact-signing-client" | ||
| New-Item -ItemType Directory -Path $toolsDir -Force | Out-Null | ||
| Push-Location $toolsDir | ||
|
|
||
| Invoke-WebRequest -Uri "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" -OutFile nuget.exe | ||
| .\nuget.exe install Microsoft.ArtifactSigning.Client -x -OutputDirectory . | ||
|
|
||
| $dlib = Get-ChildItem -Recurse -Filter "Azure.CodeSigning.Dlib.dll" | | ||
| Where-Object { $_.FullName -match '[\\/]x64[\\/]' } | | ||
| Select-Object -First 1 | ||
| if (-not $dlib) { | ||
| throw "Azure.CodeSigning.Dlib.dll (x64) not found after installing Microsoft.ArtifactSigning.Client" | ||
| } | ||
|
|
||
| $metadataPath = Join-Path $toolsDir "metadata.json" | ||
| @{ | ||
| Endpoint = "https://wus2.codesigning.azure.net/" | ||
| CodeSigningAccountName = "ChiaNetworkInc" | ||
| CertificateProfileName = "ChiaNetworkInc" | ||
| CorrelationId = "github-actions-$env:GITHUB_RUN_ID" | ||
| } | ConvertTo-Json | Set-Content -Path $metadataPath | ||
|
|
||
| Add-Content -Path $env:GITHUB_ENV -Value "AZURE_CODE_SIGNING_DLIB=$($dlib.FullName)" | ||
| Add-Content -Path $env:GITHUB_ENV -Value "AZURE_CODE_SIGNING_METADATA=$metadataPath" | ||
| Add-Content -Path $env:GITHUB_PATH -Value "C:\Program Files (x86)\Windows Kits\10\App Certification Kit" | ||
| Pop-Location | ||
|
cursor[bot] marked this conversation as resolved.
|
||
|
|
||
| - name: Build signed Electron installer | ||
| if: steps.apple-signing.outputs.available == 'true' | ||
| shell: bash | ||
| env: | ||
| CSC_LINK: ${{ secrets.APPLE_DEV_ID_APP }} | ||
| CSC_KEY_PASSWORD: ${{ secrets.APPLE_DEV_ID_APP_PASS }} | ||
| run: tools/build-electron.sh --platform=${{ matrix.platform }} | ||
|
|
||
| - name: Build signed Windows Electron installer | ||
| if: steps.windows-signing.outputs.available == 'true' | ||
| shell: bash | ||
| env: | ||
| HAS_SIGNING_SECRET: 'true' | ||
| CSC_IDENTITY_AUTO_DISCOVERY: 'false' | ||
| AZURE_TOKEN_CREDENTIALS: prod | ||
| AZURE_TENANT_ID: ${{ secrets.AZURE_SIGNING_TENANT_ID }} | ||
| AZURE_CLIENT_ID: ${{ secrets.AZURE_SIGNING_CLIENT_ID }} | ||
| run: tools/build-electron.sh --platform=${{ matrix.platform }} | ||
|
|
||
| - name: Build unsigned Electron installer | ||
| if: steps.apple-signing.outputs.available != 'true' && steps.windows-signing.outputs.available != 'true' | ||
| shell: bash | ||
| env: | ||
| CSC_IDENTITY_AUTO_DISCOVERY: 'false' | ||
| run: tools/build-electron.sh --platform=${{ matrix.platform }} | ||
|
|
||
| - name: Notarize and staple macOS installers | ||
| if: steps.apple-signing.outputs.available == 'true' | ||
| shell: bash | ||
| env: | ||
| APPLE_NOTARIZE_USERNAME: ${{ secrets.APPLE_NOTARIZE_USERNAME }} | ||
| APPLE_NOTARIZE_PASSWORD: ${{ secrets.APPLE_NOTARIZE_PASSWORD }} | ||
| APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | ||
| run: | | ||
| for dmg in desktop/release/*.dmg; do | ||
| xcrun notarytool submit \ | ||
| --wait \ | ||
| --apple-id "$APPLE_NOTARIZE_USERNAME" \ | ||
| --password "$APPLE_NOTARIZE_PASSWORD" \ | ||
| --team-id "$APPLE_TEAM_ID" \ | ||
| "$dmg" | ||
| xcrun stapler staple "$dmg" | ||
| xcrun stapler validate "$dmg" | ||
| done | ||
|
|
||
| - name: Upload installers | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: ${{ matrix.artifact }} | ||
| if-no-files-found: error | ||
| retention-days: 14 | ||
| path: | | ||
| desktop/release/*.dmg | ||
| desktop/release/*.zip | ||
| desktop/release/*.exe | ||
| desktop/release/*.AppImage | ||
| desktop/release/*.deb | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,6 +40,7 @@ pnpm-store/ | |
| # Deploy output | ||
| deploy_player_app/ | ||
| deploy_hub/ | ||
| desktop/release/ | ||
|
|
||
| # macos | ||
| .DS_Store | ||
|
|
||
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.