Build and release #228
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: Build and release | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: Build Vite | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out Git repository | |
| uses: actions/checkout@v3 | |
| - name: Get version from package.json | |
| id: package-version | |
| shell: bash | |
| run: | | |
| VERSION=$(node -p "require('./apps/desktop/package.json').version") | |
| echo "version=v${VERSION}" >> $GITHUB_OUTPUT | |
| - name: Install Bun | |
| uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: latest | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: 10.15.0 | |
| - name: Install Dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build Vite | |
| env: | |
| VITE_PUBLIC_API_URL: ${{ secrets.VITE_PUBLIC_API_URL }} | |
| VITE_PUBLIC_WEB_URL: ${{ secrets.VITE_PUBLIC_WEB_URL }} | |
| VITE_PUBLIC_AUTH_SECRET: ${{ secrets.VITE_PUBLIC_AUTH_SECRET }} | |
| VITE_PUBLIC_POSTHOG_API_KEY: ${{ secrets.VITE_PUBLIC_POSTHOG_API_KEY }} | |
| run: pnpm run build:desktop:vite | |
| # - name: Upload Sourcemaps | |
| # env: | |
| # POSTHOG_CLI_ENV_ID: ${{ secrets.POSTHOG_CLI_ENV_ID }} | |
| # POSTHOG_CLI_TOKEN: ${{ secrets.POSTHOG_CLI_TOKEN }} | |
| # run: | | |
| # pnpm exec posthog-cli --host https://eu.posthog.com sourcemap inject --directory ./apps/desktop/out/renderer | |
| # pnpm exec posthog-cli --host https://eu.posthog.com sourcemap upload --directory ./apps/desktop/out/renderer | |
| - name: Upload Build Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: desktop-dist | |
| path: ./apps/desktop/out/ | |
| retention-days: 1 | |
| build-electron: | |
| needs: build | |
| name: Build Electron | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [macos-latest, ubuntu-latest, windows-latest] | |
| steps: | |
| - name: Check out Git repository | |
| uses: actions/checkout@v3 | |
| - name: Get version from package.json | |
| id: package-version | |
| shell: bash | |
| run: | | |
| VERSION=$(node -p "require('./apps/desktop/package.json').version") | |
| echo "version=v${VERSION}" >> $GITHUB_OUTPUT | |
| - name: Install Bun | |
| uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: latest | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: 10.15.0 | |
| - name: Install Dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Download Build Artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: desktop-dist | |
| path: ./apps/desktop/out/ | |
| - name: Build Electron App | |
| env: | |
| GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
| VERSION: ${{ steps.package-version.outputs.version }} | |
| CSC_LINK: ${{ secrets.CSC_LINK }} | |
| CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }} | |
| # WIN_CSC_LINK: ${{ secrets.WIN_CSC_LINK }} | |
| # WIN_CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD }} | |
| APPLE_ID: ${{ secrets.APPLE_ID }} | |
| APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | |
| APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }} | |
| run: cd apps/desktop && pnpm run build:electron |