feat(den): move billing to org creation and enforce org limits (#1300) #393
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: Alpha Desktop Artifact (macOS arm64) | |
| on: | |
| push: | |
| branches: | |
| - dev | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: alpha-macos-aarch64-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-alpha-macos-aarch64: | |
| name: Build alpha artifact (aarch64-apple-darwin) | |
| runs-on: macos-14 | |
| timeout-minutes: 180 | |
| env: | |
| OPENCODE_GITHUB_REPO: ${{ vars.OPENCODE_GITHUB_REPO || 'anomalyco/opencode' }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.sha }} | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.27.0 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: "1.3.6" | |
| - name: Get pnpm store path | |
| id: pnpm-store | |
| shell: bash | |
| run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT" | |
| - name: Cache pnpm store | |
| uses: actions/cache@v4 | |
| continue-on-error: true | |
| with: | |
| path: ${{ steps.pnpm-store.outputs.path }} | |
| key: macos-pnpm-${{ hashFiles('pnpm-lock.yaml') }} | |
| restore-keys: | | |
| macos-pnpm- | |
| - name: Cache cargo | |
| uses: actions/cache@v4 | |
| continue-on-error: true | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| apps/desktop/src-tauri/target | |
| key: macos-cargo-${{ hashFiles('apps/desktop/src-tauri/Cargo.lock') }} | |
| restore-keys: | | |
| macos-cargo- | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile --prefer-offline | |
| - name: Create CI Tauri config (no updater artifacts) | |
| run: | | |
| node -e "const fs=require('fs'); const configPath='apps/desktop/src-tauri/tauri.conf.json'; const ciPath='apps/desktop/src-tauri/tauri.conf.alpha.json'; const config=JSON.parse(fs.readFileSync(configPath,'utf8')); config.bundle={...config.bundle, createUpdaterArtifacts:false}; fs.writeFileSync(ciPath, JSON.stringify(config, null, 2));" | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: aarch64-apple-darwin | |
| - name: Resolve OpenCode version | |
| id: opencode-version | |
| shell: bash | |
| run: | | |
| node <<'NODE' >> "$GITHUB_OUTPUT" | |
| const fs = require('fs'); | |
| const parsed = JSON.parse(fs.readFileSync('./constants.json', 'utf8')); | |
| const version = String(parsed.opencodeVersion || '').replace(/^v/, '').trim(); | |
| if (!version) { | |
| throw new Error('Pinned OpenCode version is missing from constants.json'); | |
| } | |
| console.log('version=' + version); | |
| NODE | |
| - name: Download OpenCode sidecar | |
| shell: bash | |
| env: | |
| PINNED_OPENCODE_VERSION: ${{ steps.opencode-version.outputs.version }} | |
| run: | | |
| set -euo pipefail | |
| repo="${OPENCODE_GITHUB_REPO:-anomalyco/opencode}" | |
| opencode_asset="opencode-darwin-arm64.zip" | |
| url="https://github.com/${repo}/releases/download/v${PINNED_OPENCODE_VERSION}/${opencode_asset}" | |
| tmp_dir="$RUNNER_TEMP/opencode" | |
| extract_dir="$tmp_dir/extracted" | |
| rm -rf "$tmp_dir" | |
| mkdir -p "$extract_dir" | |
| curl -fsSL --retry 5 --retry-all-errors --retry-delay 2 -o "$tmp_dir/$opencode_asset" "$url" | |
| unzip -q "$tmp_dir/$opencode_asset" -d "$extract_dir" | |
| if [ ! -f "$extract_dir/opencode" ]; then | |
| echo "OpenCode binary not found in archive" >&2 | |
| ls -la "$extract_dir" | |
| exit 1 | |
| fi | |
| mkdir -p apps/desktop/src-tauri/sidecars | |
| cp "$extract_dir/opencode" "apps/desktop/src-tauri/sidecars/opencode-aarch64-apple-darwin" | |
| chmod 755 "apps/desktop/src-tauri/sidecars/opencode-aarch64-apple-darwin" | |
| - name: Build alpha desktop app | |
| run: pnpm --filter @openwork/desktop exec tauri build --config src-tauri/tauri.conf.alpha.json --target aarch64-apple-darwin --bundles dmg,app | |
| - name: Upload alpha artifact bundle | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: openwork-alpha-macos-aarch64-${{ github.sha }} | |
| path: | | |
| apps/desktop/src-tauri/target/aarch64-apple-darwin/release/bundle/dmg/*.dmg | |
| apps/desktop/src-tauri/target/aarch64-apple-darwin/release/bundle/macos/*.app.tar.gz | |
| apps/desktop/src-tauri/target/aarch64-apple-darwin/release/bundle/macos/*.app.tar.gz.sig | |
| if-no-files-found: error | |
| retention-days: 14 |