mirror of
https://github.com/slexkit/obsidian-slexkit.git
synced 2026-07-22 07:25:12 +00:00
73 lines
2 KiB
YAML
73 lines
2 KiB
YAML
name: GitHub Release
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
description: Release version, for example 0.2.1
|
|
required: true
|
|
push:
|
|
tags:
|
|
- "[0-9]+.[0-9]+.[0-9]+"
|
|
|
|
permissions:
|
|
contents: write
|
|
id-token: write
|
|
attestations: write
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Bun
|
|
uses: oven-sh/setup-bun@v2
|
|
with:
|
|
bun-version: 1.3.14
|
|
|
|
- name: Install dependencies
|
|
run: bun install --frozen-lockfile
|
|
|
|
- name: Check
|
|
run: bun run check
|
|
|
|
- name: Verify generated assets are committed
|
|
run: git diff --exit-code -- main.js manifest.json styles.css versions.json
|
|
|
|
- name: Verify version tag
|
|
id: version
|
|
run: |
|
|
TAG="${{ github.event_name == 'workflow_dispatch' && inputs.version || github.ref_name }}"
|
|
MANIFEST_VERSION="$(node -p "require('./manifest.json').version")"
|
|
if [ "$TAG" != "$MANIFEST_VERSION" ]; then
|
|
echo "Tag $TAG does not match manifest version $MANIFEST_VERSION"
|
|
exit 1
|
|
fi
|
|
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Attest release assets
|
|
uses: actions/attest-build-provenance@v3
|
|
with:
|
|
subject-path: |
|
|
main.js
|
|
styles.css
|
|
manifest.json
|
|
|
|
- name: Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
tag_name: ${{ steps.version.outputs.tag }}
|
|
body: |
|
|
## SlexKit for Obsidian ${{ steps.version.outputs.tag }}
|
|
|
|
This release is built from the tagged source in GitHub Actions.
|
|
|
|
- Renders explicit `slex` Markdown fences in reading mode.
|
|
- Includes scoped release CSS for the Obsidian host.
|
|
- Ships the required plugin assets only: `main.js`, `manifest.json`, and `styles.css`.
|
|
files: |
|
|
main.js
|
|
manifest.json
|
|
styles.css
|