Files
wehub-resource-sync 6ede33ccdb
Build and Push Docker Images / build (./surfsense_web, cpu, ./surfsense_web/Dockerfile, web, surfsense-web, ubuntu-24.04-arm, linux/arm64, arm64, , runner, false, cpu) (push) Blocked by required conditions
Build and Push Docker Images / build (./surfsense_web, cpu, ./surfsense_web/Dockerfile, web, surfsense-web, ubuntu-latest, linux/amd64, amd64, , runner, false, cpu) (push) Blocked by required conditions
Build and Push Docker Images / compute_version (push) Waiting to run
Build and Push Docker Images / build (./surfsense_backend, cpu, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-24.04-arm, linux/arm64, arm64, , production, false, cpu) (push) Blocked by required conditions
Build and Push Docker Images / build (./surfsense_backend, cu126, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-24.04-arm, linux/arm64, arm64, -cuda126, production, true, cuda126) (push) Blocked by required conditions
Build and Push Docker Images / build (./surfsense_backend, cu126, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-latest, linux/amd64, amd64, -cuda126, production, true, cuda126) (push) Blocked by required conditions
Build and Push Docker Images / build (./surfsense_backend, cu128, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-latest, linux/amd64, amd64, -cuda, production, true, cuda) (push) Blocked by required conditions
Build and Push Docker Images / verify_digests (push) Blocked by required conditions
Build and Push Docker Images / create_manifest (backend, surfsense-backend, , cpu) (push) Blocked by required conditions
Build and Push Docker Images / build (./surfsense_backend, cpu, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-latest, linux/amd64, amd64, , production, false, cpu) (push) Blocked by required conditions
Build and Push Docker Images / build (./surfsense_backend, cu128, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-24.04-arm, linux/arm64, arm64, -cuda, production, true, cuda) (push) Blocked by required conditions
Build and Push Docker Images / create_manifest (backend, surfsense-backend, -cuda, cuda) (push) Blocked by required conditions
Build and Push Docker Images / create_manifest (backend, surfsense-backend, -cuda126, cuda126) (push) Blocked by required conditions
Build and Push Docker Images / create_manifest (web, surfsense-web, , cpu) (push) Blocked by required conditions
Build and Push Docker Images / finalize_release (push) Blocked by required conditions
Obsidian Plugin Lint / lint (push) Waiting to run
chore: import upstream snapshot with attribution
2026-07-13 13:33:44 +08:00

120 lines
4.3 KiB
YAML

name: Release Obsidian Plugin
# Tag format: `obsidian-v<version>` and `<version>` must match `surfsense_obsidian/manifest.json` exactly.
on:
push:
tags:
- "obsidian-v*"
workflow_dispatch:
inputs:
publish:
description: "Publish to GitHub Releases"
required: true
type: choice
options:
- never
- always
default: "never"
permissions:
contents: write
jobs:
build-and-release:
runs-on: ubuntu-latest
defaults:
run:
working-directory: surfsense_obsidian
steps:
- uses: actions/checkout@v6
with:
# Need write access for the manifest/versions.json mirror commit
# back to main further down.
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-node@v6
with:
node-version: 22.x
cache: npm
cache-dependency-path: surfsense_obsidian/package-lock.json
- name: Resolve plugin version
id: version
run: |
manifest_version=$(node -p "require('./manifest.json').version")
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
# Manual runs derive the release version from manifest.json.
version="$manifest_version"
tag="obsidian-v$version"
else
tag="${GITHUB_REF_NAME}"
if [ -z "$tag" ] || [[ "$tag" != obsidian-v* ]]; then
echo "::error::Invalid tag '$tag'. Expected format: obsidian-v<version>"
exit 1
fi
version="${tag#obsidian-v}"
if [ "$version" != "$manifest_version" ]; then
echo "::error::Tag version '$version' does not match manifest version '$manifest_version'"
exit 1
fi
fi
echo "tag=$tag" >> "$GITHUB_OUTPUT"
echo "version=$version" >> "$GITHUB_OUTPUT"
- name: Resolve publish mode
id: release_mode
run: |
if [ "${{ github.event_name }}" = "push" ] || [ "${{ inputs.publish }}" = "always" ]; then
echo "should_publish=true" >> "$GITHUB_OUTPUT"
else
echo "should_publish=false" >> "$GITHUB_OUTPUT"
fi
- run: npm ci
- run: npm run lint
- run: npm run build
- name: Verify build artifacts
run: |
for f in main.js manifest.json styles.css; do
test -f "$f" || (echo "::error::Missing release artifact: $f" && exit 1)
done
- name: Mirror manifest.json + versions.json to repo root
if: steps.release_mode.outputs.should_publish == 'true'
working-directory: ${{ github.workspace }}
run: |
cp surfsense_obsidian/manifest.json manifest.json
cp surfsense_obsidian/versions.json versions.json
if git diff --quiet manifest.json versions.json; then
echo "Root manifest/versions already up to date."
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add manifest.json versions.json
git commit -m "chore(obsidian-plugin): mirror manifest+versions for ${{ steps.version.outputs.tag }}"
# Push to the default branch so Obsidian can fetch raw files from HEAD.
if ! git push origin HEAD:${{ github.event.repository.default_branch }}; then
echo "::warning::Failed to push mirrored manifest/versions to default branch (likely branch protection). Continuing release."
fi
# Publish release under bare `manifest.json` version (no `obsidian-v` prefix) for BRAT/store compatibility.
# `make_latest: "false"` keeps the desktop app's `v*` release headlined since Obsidian and BRAT resolve plugins via getReleaseByTag, not the latest flag.
- name: Create GitHub release
if: steps.release_mode.outputs.should_publish == 'true'
uses: softprops/action-gh-release@v3
with:
tag_name: ${{ steps.version.outputs.version }}
name: SurfSense Obsidian Plugin ${{ steps.version.outputs.version }}
generate_release_notes: true
make_latest: "false"
files: |
surfsense_obsidian/main.js
surfsense_obsidian/manifest.json
surfsense_obsidian/styles.css