Boilerplate derived from obsidianmd/obsidian-sample-plugin, adapted to mirror obsidian-plugin-auto-task-status: bun scripts, esbuild with git-tag versioning, prettier/eslint/jest, husky pre-commit, Forgejo CI/release workflows, and vault install/symlink helpers.
43 lines
1.1 KiB
YAML
43 lines
1.1 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- '*'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: docker
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- uses: actions/setup-bun@v2
|
|
|
|
- name: Install dependencies
|
|
run: bun install --frozen-lockfile
|
|
|
|
- name: Build
|
|
run: bun run build
|
|
|
|
- name: Package
|
|
run: |
|
|
VERSION="${{ github.ref_name }}"
|
|
PLUGIN_ID=$(bun -p 'JSON.parse(require("fs").readFileSync("manifest.json","utf8")).id')
|
|
STAGING="${PLUGIN_ID}-${VERSION}"
|
|
mkdir -p "${STAGING}"
|
|
cp dist/main.js dist/manifest.json "${STAGING}/"
|
|
if [ -f dist/styles.css ]; then cp dist/styles.css "${STAGING}/"; fi
|
|
tar -czf "dist/${PLUGIN_ID}-${VERSION}.tar.gz" "${STAGING}"
|
|
rm -rf "${STAGING}"
|
|
|
|
- name: Release
|
|
uses: actions/forgejo-release@v2.11.1
|
|
with:
|
|
direction: upload
|
|
url: ${{ github.server_url }}
|
|
repo: ${{ github.repository }}
|
|
tag: ${{ github.ref_name }}
|
|
token: ${{ github.token }}
|
|
release-dir: dist
|