Skip to content

Commit

Permalink
add stuf
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminshafii committed Dec 20, 2024
1 parent 7d2ca8c commit 1f81488
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Release Obsidian Plugin

on:
push:
tags:
- "test-*"
- "*"

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: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Install dependencies
run: pnpm install

- name: Build plugin
run: pnpm --filter "./packages/plugin" build

- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "Creating release for tag ${GITHUB_REF#refs/tags/}"
if [[ ${GITHUB_REF#refs/tags/} == test-* ]]; then
echo "TEST MODE: Would create release with files:"
echo "- packages/plugin/dist/main.js"
echo "- packages/plugin/manifest.json"
echo "- packages/plugin/dist/styles.css"
# Verify files exist
ls -la packages/plugin/dist/main.js packages/plugin/manifest.json packages/plugin/dist/styles.css || true
else
gh release create "${GITHUB_REF#refs/tags/}" \
--title="${GITHUB_REF#refs/tags/}" \
--draft=false \
--prerelease=false \
packages/plugin/dist/main.js packages/plugin/manifest.json packages/plugin/dist/styles.css
fi

0 comments on commit 1f81488

Please sign in to comment.