mirror of
https://github.com/markusmo3/obsidian-private-mode.git
synced 2026-07-22 05:42:42 +00:00
39 lines
1.1 KiB
YAML
39 lines
1.1 KiB
YAML
# Source: https://docs.obsidian.md/Plugins/Releasing/Release+your+plugin+with+GitHub+Actions
|
|
name: Release Obsidian plugin
|
|
on:
|
|
push:
|
|
tags:
|
|
- "*"
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Use Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: "18.x"
|
|
|
|
- name: Build plugin
|
|
run: |
|
|
npm install
|
|
npm run build
|
|
|
|
- name: Create release
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
PLUGIN_NAME: ${{ github.event.repository.name }}
|
|
run: |
|
|
mkdir ${PLUGIN_NAME}
|
|
for f in main.js manifest.json styles.scss styles.css; do
|
|
if [[ -f $f ]]; then
|
|
cp $f "${PLUGIN_NAME}/"
|
|
fi
|
|
done
|
|
zip -r "${PLUGIN_NAME}".zip "$PLUGIN_NAME"
|
|
|
|
tag="${GITHUB_REF#refs/tags/}"
|
|
gh release create "$tag" --generate-notes ${PLUGIN_NAME}.zip
|