This repository was archived by the owner on Jun 8, 2026. It is now read-only.
Add description and author to desktop package.json #3
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: Release Desktop | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "apps/desktop/**" | |
| workflow_dispatch: | |
| concurrency: | |
| group: release-desktop | |
| cancel-in-progress: false | |
| env: | |
| SKIP: "false" | |
| jobs: | |
| release: | |
| runs-on: macos-latest | |
| timeout-minutes: 30 | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Read version from package.json | |
| id: version | |
| run: | | |
| VERSION=$(node -p "require('./apps/desktop/package.json').version") | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - name: Check if version already released | |
| id: check_release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| VERSION="${{ steps.version.outputs.version }}" | |
| if gh release view "v$VERSION" --repo "${{ github.repository }}" > /dev/null 2>&1; then | |
| echo "skip=true" >> $GITHUB_OUTPUT | |
| echo "::warning::Version $VERSION already released — skipping build. Bump the version in apps/desktop/package.json to trigger a new release." | |
| else | |
| echo "skip=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Install pnpm | |
| if: steps.check_release.outputs.skip != 'true' | |
| uses: pnpm/action-setup@v4 | |
| - name: Setup Node.js | |
| if: steps.check_release.outputs.skip != 'true' | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - name: Install dependencies | |
| if: steps.check_release.outputs.skip != 'true' | |
| run: pnpm install --frozen-lockfile | |
| - name: Generate build info | |
| if: steps.check_release.outputs.skip != 'true' | |
| run: pnpm -r prebuild | |
| - name: Typecheck | |
| if: steps.check_release.outputs.skip != 'true' | |
| run: pnpm -C apps/desktop typecheck | |
| - name: Run tests | |
| if: steps.check_release.outputs.skip != 'true' | |
| run: pnpm -C apps/desktop test | |
| - name: Build and publish to GitHub Releases | |
| if: steps.check_release.outputs.skip != 'true' | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: pnpm -C apps/desktop release | |
| - name: Upload DMG as workflow artifact | |
| if: steps.check_release.outputs.skip != 'true' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ClosedLoop-macOS-${{ steps.version.outputs.version }} | |
| path: apps/desktop/dist-dmg/*.dmg | |
| if-no-files-found: error | |
| - name: Build Slack message | |
| if: steps.check_release.outputs.skip != 'true' | |
| id: slack_message | |
| run: | | |
| VERSION="${{ steps.version.outputs.version }}" | |
| RELEASE_URL="https://github.com/${{ github.repository }}/releases/tag/v${VERSION}" | |
| RUN_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
| MSG=$(printf "New ClosedLoop Desktop build ready\nVersion: %s\nRelease: %s\nArtifact: %s" \ | |
| "$VERSION" "$RELEASE_URL" "$RUN_URL") | |
| echo "message<<EOF" >> $GITHUB_OUTPUT | |
| echo "$MSG" >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| - name: Notify Slack | |
| if: steps.check_release.outputs.skip != 'true' | |
| continue-on-error: true | |
| uses: ./.github/actions/slack-notify | |
| with: | |
| webhook_url: ${{ secrets.SLACK_GITHUB_REPO_WEBHOOK_URL }} | |
| message: ${{ steps.slack_message.outputs.message }} |