mirror of
https://github.com/0xneobyte/VaultAI.git
synced 2026-07-22 13:10:30 +00:00
47 lines
1.6 KiB
YAML
47 lines
1.6 KiB
YAML
name: Build obsidian plugin
|
|
|
|
on:
|
|
push:
|
|
# Sequence of patterns matched against refs/tags
|
|
tags:
|
|
- "*" # Push events to matching any tag format, i.e. 1.0, 20.15.10
|
|
|
|
# Add permissions for GitHub Actions
|
|
permissions:
|
|
contents: write
|
|
|
|
env:
|
|
PLUGIN_NAME: vault-ai # Change this to the name of your plugin-id folder
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Use Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: "20.x" # Updated to Node 20 for @google/genai compatibility
|
|
- name: Build
|
|
id: build
|
|
run: |
|
|
npm ci
|
|
npm run build --if-present
|
|
mkdir ${{ env.PLUGIN_NAME }}
|
|
cp main.js manifest.json styles.css ${{ env.PLUGIN_NAME }}
|
|
zip -r ${{ env.PLUGIN_NAME }}.zip ${{ env.PLUGIN_NAME }}
|
|
ls
|
|
echo "tag_name=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
|
- name: Create Release
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
tag="${GITHUB_REF#refs/tags/}"
|
|
gh release create "$tag" --title="$tag" --generate-notes --draft=false
|
|
- name: Upload Release Assets
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
tag="${GITHUB_REF#refs/tags/}"
|
|
gh release upload "$tag" main.js manifest.json styles.css "${{ env.PLUGIN_NAME }}.zip"
|