jacobinwwey_obsidian-NotEMD/.github/workflows/release.yml
2026-04-14 00:23:20 -05:00

63 lines
1.4 KiB
YAML

name: Release
on:
push:
tags:
- '*.*.*'
- 'v*.*.*'
- 'V*.*.*'
workflow_dispatch:
inputs:
tag:
description: Existing git tag to publish or repair
required: true
type: string
permissions:
contents: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Check out release ref
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event_name == 'workflow_dispatch' && format('refs/tags/{0}', inputs.tag) || github.ref }}
- name: Resolve tag name
shell: bash
run: |
TAG_NAME="${GITHUB_REF_NAME}"
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
TAG_NAME="${{ inputs.tag }}"
fi
echo "TAG_NAME=$TAG_NAME" >> "$GITHUB_ENV"
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- name: Build plugin
run: npm run build
- name: Run test suite
run: npm test -- --runInBand
- name: Audit UI i18n surfaces
run: npm run audit:i18n-ui
- name: Check diff hygiene
run: git diff --check
- name: Publish or repair GitHub release assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm run release:github -- "$TAG_NAME"