Main - Obsidian Beta Release #33
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: Main - Obsidian Beta Release | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "apps/obsidian/**" | |
| - "packages/database/**" | |
| - "packages/utils/**" | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: obsidian-beta-release | |
| cancel-in-progress: false | |
| env: | |
| OBSIDIAN_PLUGIN_REPO_TOKEN: ${{ secrets.OBSIDIAN_PLUGIN_REPO_TOKEN }} | |
| PUBLISH_REPO: DiscourseGraphs/discourse-graph-obsidian | |
| # Inlined into the bundle at build time by scripts/compile.ts. Without it the | |
| # plugin falls back to a dev URL, so released builds call localhost. | |
| NEXT_API_ROOT: https://discoursegraphs.com/api | |
| SUPABASE_URL: ${{ secrets.SUPABASE_URL }} | |
| SUPABASE_PUBLISHABLE_KEY: ${{ secrets.SUPABASE_PUBLISHABLE_KEY }} | |
| GH_TOKEN: ${{ github.token }} | |
| jobs: | |
| beta-release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v6 | |
| with: | |
| version: 10.15.1 | |
| run_install: false | |
| - name: Setup Node.js environment | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "22" | |
| cache: "pnpm" | |
| - name: Install Dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Compute next beta version | |
| id: version | |
| env: | |
| # Releases exist only in the publish repo, never in the monorepo, so the | |
| # lookup needs an explicit --repo and a token that can read that repo. | |
| GH_TOKEN: ${{ env.OBSIDIAN_PLUGIN_REPO_TOKEN }} | |
| run: | | |
| # manifest.json is the plugin's canonical version: it is what Obsidian | |
| # and the community store read. package.json is private and its version | |
| # is incidental. | |
| STABLE_VERSION=$(node -p "require('./apps/obsidian/manifest.json').version") | |
| LATEST_N=$(gh release list --repo "$PUBLISH_REPO" --limit 100 --json tagName --jq '.[].tagName' \ | |
| | grep "^${STABLE_VERSION}-beta\." \ | |
| | sed "s/^${STABLE_VERSION}-beta\.//" \ | |
| | sort -n | tail -1) | |
| NEXT_BETA="${STABLE_VERSION}-beta.$(( ${LATEST_N:-0} + 1 ))" | |
| echo "Stable version: $STABLE_VERSION, next beta: $NEXT_BETA" | |
| echo "version=$NEXT_BETA" >> "$GITHUB_OUTPUT" | |
| - name: Publish beta release | |
| run: cd apps/obsidian && npx tsx scripts/publish.ts --version ${{ steps.version.outputs.version }} | |
| - name: Sync Linear release | |
| uses: linear/linear-release-action@v0 | |
| with: | |
| access_key: ${{ secrets.LINEAR_RELEASES_ACCESS_KEY_OBSIDIAN }} | |
| include_paths: "apps/obsidian/**,packages/database/**,packages/utils/**" |