This repository was archived by the owner on Jun 8, 2026. It is now read-only.
Release Desktop #110
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: | |
| 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 | |
| packages: read | |
| 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: | |
| GITHUB_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 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Generate build info | |
| if: steps.check_release.outputs.skip != 'true' | |
| run: pnpm -r prebuild | |
| - name: Lint | |
| if: steps.check_release.outputs.skip != 'true' | |
| run: pnpm -C apps/desktop lint | |
| - 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: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| CSC_LINK: ${{ secrets.APPLE_CSC_LINK }} | |
| CSC_KEY_PASSWORD: ${{ secrets.APPLE_CSC_KEY_PASSWORD }} | |
| APPLE_ID: ${{ secrets.APPLE_ID }} | |
| APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }} | |
| APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | |
| run: pnpm -C apps/desktop release | |
| - name: Publish release (undraft) | |
| if: steps.check_release.outputs.skip != 'true' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: gh release edit "v${{ steps.version.outputs.version }}" --draft=false --repo "${{ github.repository }}" | |
| - 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}" | |
| MSG=$(printf "ClosedLoop Gateway build ready\nVersion: %s\nRelease: %s" \ | |
| "$VERSION" "$RELEASE_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 }} |