release: 4.14.7 #672
Workflow file for this run
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
| # SOURCE: https://docs.obsidian.md/Plugins/Releasing/Release+your+plugin+with+GitHub+Actions | |
| name: Release Obsidian plugin | |
| on: | |
| push: | |
| tags: | |
| - "[1-9]*" | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| attestations: write | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: 1.3.14 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build plugin | |
| run: | | |
| bun install --frozen-lockfile | |
| bun run test || exit 1 | |
| bun run build || exit 1 | |
| - name: Attest build artifacts | |
| uses: actions/attest-build-provenance@v4 | |
| with: | |
| subject-path: | | |
| main.js | |
| styles.css | |
| wasm/pkg/breadcrumbs_graph_wasm_bg.wasm | |
| - name: Create release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| tag="${GITHUB_REF#refs/tags/}" | |
| prerelease_flag="" | |
| latest_flag="" | |
| if [[ "$tag" == *beta* ]]; then | |
| prerelease_flag="--prerelease" | |
| else | |
| # Stable releases must originate from main or the 1.12-compat | |
| # maintenance branch (older Obsidian versions). | |
| branch=$(git branch -r --contains "$GITHUB_SHA" | grep -E '^\s*origin/(main|1\.12-compat)$' || true) | |
| if [[ -z "$branch" ]]; then | |
| echo "ERROR: Stable tag '$tag' was not pushed from main or 1.12-compat. Aborting." | |
| exit 1 | |
| fi | |
| # Releases from 1.12-compat target older Obsidian users only — | |
| # don't let them supersede main's release as "Latest". | |
| if echo "$branch" | grep -qE 'origin/1\.12-compat$'; then | |
| latest_flag="--latest=false" | |
| fi | |
| fi | |
| # Obsidian only downloads main.js, manifest.json, styles.css. | |
| # BRAT (v1.1.0+) reads manifest.json from the release assets directly | |
| # and ignores manifest-beta.json entirely — there's no separate beta | |
| # manifest to publish. | |
| gh release create "$tag" \ | |
| --title="$tag" \ | |
| $prerelease_flag \ | |
| $latest_flag \ | |
| main.js manifest.json styles.css |