Building #8
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: macOS Beta Nightly Build | |
| on: | |
| # Run nightly at midnight UTC | |
| schedule: | |
| - cron: '0 3 * * *' | |
| push: | |
| branches: | |
| - june-29 | |
| - master | |
| # Allow manual triggering | |
| workflow_dispatch: | |
| jobs: | |
| generate-version: | |
| runs-on: blacksmith-4vcpu-ubuntu-2204 | |
| outputs: | |
| beta_version: ${{ steps.set-version.outputs.beta_version }} | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Generate beta version in package.json | |
| run: | | |
| # Get base version from package.json | |
| BASE_VERSION=$(node -p "require('./package.json').version.split('.').slice(0, 2).join('.')") | |
| # Create a timestamp (Unix epoch time in seconds) | |
| TIMESTAMP=$(date +%s) | |
| # Final beta version with timestamp | |
| BETA_VERSION="${BASE_VERSION}.${TIMESTAMP}" | |
| echo "Beta version: $BETA_VERSION" | |
| echo "beta_version=${BETA_VERSION}" >> $GITHUB_OUTPUT | |
| id: set-version | |
| conveyor-beta-build: | |
| name: Build Beta macOS App | |
| runs-on: blacksmith-4vcpu-ubuntu-2204 | |
| needs: [generate-version] | |
| permissions: | |
| contents: write | |
| pages: write | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: useblacksmith/setup-node@v5 | |
| with: | |
| node-version: '22' | |
| - name: Install Dependencies | |
| run: npm install | |
| # Add PostHog CLI installation and authentication | |
| # - name: Install PostHog CLI | |
| # run: | | |
| # curl --proto '=https' --tlsv1.2 -LsSf https://github.com/PostHog/posthog/releases/download/posthog-cli-v0.0.4/posthog-cli-installer.sh | sh | |
| # posthog-cli-update | |
| # - name: Authenticate PostHog CLI | |
| # env: | |
| # POSTHOG_CLI_ENV_ID: ${{ secrets.POSTHOG_CLI_ENV_ID }} | |
| # POSTHOG_CLI_TOKEN: ${{ secrets.POSTHOG_CLI_TOKEN }} | |
| # run: echo "PostHog CLI authenticated via environment variables" | |
| # - name: Process and Upload Source Maps | |
| # env: | |
| # POSTHOG_CLI_ENV_ID: 144291 | |
| # POSTHOG_CLI_TOKEN: phx_16RRjmk850E6iWtkYaMbn9FsZQRq0FlHDTRJdeOVCaJYCxZR | |
| # run: | | |
| # echo "Injecting source maps for PostHog..." | |
| # posthog-cli sourcemap inject --directory ./apps/main/dist | |
| # echo "Uploading source maps to PostHog..." | |
| # posthog-cli sourcemap upload --directory ./apps/main/dist | |
| - name: Build Repo | |
| run: | | |
| npm run build:beta | |
| # - name: Prepare Signing Certificates | |
| # run: | | |
| # mkdir -p build | |
| # # echo "${{ secrets.APPLE_CERT }}" | base64 --decode > build/developerID_application.cer | |
| # # echo "${{ secrets.SPARKLE_KEY }}" | base64 --decode > sparkle.key | |
| # # echo "${{ secrets.APPLE_NOTARIZATION_PRIVATE_KEY }}" > AuthKey_W442ZA3W3A.p8 | |
| - name: Setup build environment | |
| run: | | |
| npm run make:beta | |
| - name: Update package.json with beta version | |
| run: | | |
| # Update package.json with the beta version using npm pkg | |
| npm pkg set version="${{ needs.generate-version.outputs.beta_version }}-beta" | |
| - name: Run Conveyor for Beta Build | |
| uses: hydraulic-software/conveyor/actions/build@v18.1 | |
| env: | |
| APPLE_ASP: ${{ secrets.APPLE_ASP }} | |
| # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| SITE_RELEASE_TOKEN: ${{ secrets.SITE_RELEASE_TOKEN }} | |
| NODE_ENV: production | |
| ENV: production | |
| MODE: beta | |
| BUILD_VERSION: ${{ needs.generate-version.outputs.beta_version }} | |
| APPLE_NOTARIZATION_ISSUER_ID: ${{ secrets.APPLE_NOTARIZATION_ISSUER_ID }} | |
| APPLE_NOTARIZATION_KEY_ID: ${{ secrets.APPLE_NOTARIZATION_KEY_ID }} | |
| APPLE_NOTARIZATION_PRIVATE_KEY: ${{ secrets.APPLE_NOTARIZATION_PRIVATE_KEY }} | |
| with: | |
| command: make copied-site | |
| signing_key: ${{ secrets.SIGNING_KEY }} | |
| extra_flags: -f conveyor.beta.conf | |
| agree_to_license: 1 | |
| - name: Restore Original Node Modules | |
| run: | | |
| echo "🔄 Restoring original node_modules..." | |
| if [ -d "node_modules.bk" ]; then | |
| # Remove any node_modules directory that might have been created | |
| if [ -d "node_modules" ]; then | |
| rm -rf node_modules | |
| fi | |
| mv node_modules.bk node_modules | |
| echo "✅ Node modules restored successfully" | |
| else | |
| echo "⚠️ Warning: node_modules.bk not found for restoration" | |
| fi |