Repository navigation
feat(desktop): add canary build workflow for internal testing #721
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
Merged
+336
−92
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
a63eb3c
feat(desktop): add canary build workflow for internal testing
Kitenite 0eacc0c
fix(desktop): separate auto-update feeds for stable and canary builds
Kitenite a03cde2
chore(desktop): update gh-release action to v2, fix canary timestamp
Kitenite 2fc96d6
fix(desktop): expose build_time in job outputs
Kitenite 47d8264
fix(desktop): skip release job when build is skipped
Kitenite 1ed2d24
refactor(desktop): use electron-builder channel pattern for auto-updates
Kitenite 2bea2cb
cron 12am and 12pm
Kitenite c582339
Lint
Kitenite f88613c
fix(desktop): restore setFeedURL for reliable auto-updates
Kitenite 9b715ec
Clean up
Kitenite 748cbb5
fix(desktop): remove channel config to ensure latest-mac.yml is gener…
Kitenite 18ff200
fix(desktop): use glob for manifest upload, fix package.json version
Kitenite 1a11351
lint
Kitenite f40dce0
Merge remote-tracking branch 'origin' into canary-supp
Kitenite a5c8e78
fix(desktop): use shared protocol scheme for canary
Kitenite 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,128 @@ | ||
| name: Build Desktop App | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| channel: | ||
| description: "Release channel (stable or canary)" | ||
| required: true | ||
| type: string | ||
| version_suffix: | ||
| description: "Version suffix to append (e.g., -canary). Empty for stable." | ||
| required: false | ||
| type: string | ||
| default: "" | ||
| electron_builder_config: | ||
| description: "Electron builder config file" | ||
| required: false | ||
| type: string | ||
| default: "electron-builder.ts" | ||
| artifact_prefix: | ||
| description: "Prefix for artifact names" | ||
| required: false | ||
| type: string | ||
| default: "desktop" | ||
| artifact_retention_days: | ||
| description: "Number of days to retain artifacts" | ||
| required: false | ||
| type: number | ||
| default: 30 | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build - macOS (${{ matrix.arch }}) | ||
| runs-on: macos-latest | ||
| environment: production | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| arch: [arm64] | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Bun | ||
| uses: oven-sh/setup-bun@v1 | ||
| with: | ||
| bun-version: "1.3.2" | ||
|
|
||
| - name: Cache dependencies | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| ~/.bun/install/cache | ||
| key: ${{ runner.os }}-bun-${{ github.sha }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-bun- | ||
|
|
||
| - name: Install dependencies | ||
| run: bun install --frozen | ||
|
|
||
| - name: Set version suffix | ||
| if: inputs.version_suffix != '' | ||
| working-directory: apps/desktop | ||
| run: | | ||
| # Read current version and append suffix | ||
| CURRENT_VERSION=$(node -p "require('./package.json').version") | ||
| NEW_VERSION="${CURRENT_VERSION}${{ inputs.version_suffix }}" | ||
| echo "Setting version to: $NEW_VERSION" | ||
| # Update package.json version using node | ||
| node -e " | ||
| const fs = require('fs'); | ||
| const pkg = require('./package.json'); | ||
| pkg.version = '$NEW_VERSION'; | ||
| fs.writeFileSync('./package.json', JSON.stringify(pkg, null, '\t') + '\n'); | ||
| " | ||
| echo "Updated package.json version to $NEW_VERSION" | ||
|
|
||
| - name: Clean dev folder | ||
| working-directory: apps/desktop | ||
| run: bun run clean:dev | ||
|
|
||
| - name: Compile app with electron-vite | ||
| working-directory: apps/desktop | ||
| env: | ||
| NEXT_PUBLIC_POSTHOG_KEY: ${{ secrets.NEXT_PUBLIC_POSTHOG_KEY }} | ||
| NEXT_PUBLIC_POSTHOG_HOST: ${{ secrets.NEXT_PUBLIC_POSTHOG_HOST }} | ||
| GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }} | ||
| GH_CLIENT_ID: ${{ secrets.GH_CLIENT_ID }} | ||
| NEXT_PUBLIC_WEB_URL: ${{ secrets.NEXT_PUBLIC_WEB_URL }} | ||
| NEXT_PUBLIC_API_URL: ${{ secrets.NEXT_PUBLIC_API_URL }} | ||
| SENTRY_DSN_DESKTOP: ${{ secrets.SENTRY_DSN_DESKTOP }} | ||
| run: bun run compile:app | ||
|
|
||
| - name: Build Electron app | ||
| working-directory: apps/desktop | ||
| env: | ||
| CSC_LINK: ${{ secrets.MAC_CERTIFICATE }} | ||
| CSC_KEY_PASSWORD: ${{ secrets.MAC_CERTIFICATE_PASSWORD }} | ||
| APPLE_ID: ${{ secrets.APPLE_ID }} | ||
| APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} | ||
| APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | ||
| run: bun run package -- --publish never --config ${{ inputs.electron_builder_config }} | ||
|
|
||
| - name: Upload DMG artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: ${{ inputs.artifact_prefix }}-mac-${{ matrix.arch }}-dmg | ||
| path: apps/desktop/release/*.dmg | ||
| retention-days: ${{ inputs.artifact_retention_days }} | ||
| if-no-files-found: error | ||
|
|
||
| - name: Upload ZIP artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: ${{ inputs.artifact_prefix }}-mac-${{ matrix.arch }}-zip | ||
| path: apps/desktop/release/*.zip | ||
| retention-days: ${{ inputs.artifact_retention_days }} | ||
| if-no-files-found: error | ||
|
|
||
| - name: Upload auto-update manifest | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: ${{ inputs.artifact_prefix }}-mac-update-manifest | ||
| path: apps/desktop/release/*-mac.yml | ||
| retention-days: ${{ inputs.artifact_retention_days }} | ||
| if-no-files-found: error | ||
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,111 @@ | ||
| name: Release Desktop Canary | ||
|
|
||
| on: | ||
| schedule: | ||
| # Every 12 hours at 12 AM and 12 PM UTC | ||
| - cron: "0 0,12 * * *" | ||
| workflow_dispatch: # Manual trigger for testing | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| check-changes: | ||
| name: Check for changes | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| should_build: ${{ steps.check.outputs.should_build }} | ||
| short_sha: ${{ steps.check.outputs.short_sha }} | ||
|
coderabbitai[bot] marked this conversation as resolved.
Resolved
|
||
| build_time: ${{ steps.check.outputs.build_time }} | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Check for changes since last canary | ||
| id: check | ||
| run: | | ||
| SHORT_SHA=$(git rev-parse --short HEAD) | ||
| echo "short_sha=$SHORT_SHA" >> $GITHUB_OUTPUT | ||
|
|
||
| # Capture build timestamp (works for both scheduled and manual runs) | ||
| echo "build_time=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT | ||
|
|
||
| # Get the commit SHA of the last canary release | ||
| LAST_CANARY_SHA=$(git rev-parse desktop-canary 2>/dev/null || echo "") | ||
|
|
||
| if [ -z "$LAST_CANARY_SHA" ]; then | ||
| echo "No previous canary release found, building..." | ||
| echo "should_build=true" >> $GITHUB_OUTPUT | ||
| elif [ "$LAST_CANARY_SHA" = "$(git rev-parse HEAD)" ]; then | ||
| echo "No changes since last canary release, skipping..." | ||
| echo "should_build=false" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "Changes detected since last canary, building..." | ||
| echo "should_build=true" >> $GITHUB_OUTPUT | ||
| fi | ||
|
|
||
| build: | ||
| needs: check-changes | ||
| if: needs.check-changes.outputs.should_build == 'true' | ||
| uses: ./.github/workflows/build-desktop.yml | ||
| with: | ||
| channel: canary | ||
| version_suffix: "-canary" | ||
| electron_builder_config: electron-builder.canary.ts | ||
| artifact_prefix: desktop-canary | ||
| artifact_retention_days: 7 | ||
| secrets: inherit | ||
|
|
||
| release: | ||
| name: Update Canary Release | ||
| needs: [check-changes, build] | ||
| if: needs.check-changes.outputs.should_build == 'true' | ||
| runs-on: ubuntu-latest | ||
|
|
||
|
coderabbitai[bot] marked this conversation as resolved.
Resolved
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Download all artifacts | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| path: release-artifacts | ||
| pattern: desktop-canary-* | ||
| merge-multiple: true | ||
|
|
||
| - name: List artifacts | ||
| run: | | ||
| echo "Release artifacts:" | ||
| ls -la release-artifacts/ | ||
|
|
||
| - name: Delete existing canary release | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| # Delete existing release if it exists | ||
| gh release delete desktop-canary --yes || true | ||
| # Delete the tag | ||
| git push origin :refs/tags/desktop-canary || true | ||
|
|
||
| - name: Create Canary Release | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| tag_name: desktop-canary | ||
| name: "Superset Desktop Canary" | ||
| body: | | ||
| **Internal Testing Build** | ||
|
|
||
| This is an automated canary build from `main` branch. | ||
|
|
||
| - Commit: ${{ github.sha }} | ||
| - Short SHA: ${{ needs.check-changes.outputs.short_sha }} | ||
| - Built: ${{ needs.check-changes.outputs.build_time }} | ||
|
|
||
| ⚠️ This build is for internal testing only and may be unstable. | ||
| prerelease: true | ||
| files: release-artifacts/* | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
Kitenite marked this conversation as resolved.
Resolved
|
||
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.