generated from obsidianmd/obsidian-sample-plugin
-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
283c364
commit 84331d1
Showing
11 changed files
with
185 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1 @@ | ||
name: Build Obsidian Plugin | ||
|
||
on: push | ||
|
||
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 build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,59 @@ | ||
name: Release Obsidian plugin | ||
name: Release Obsidian Plugin | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
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 }} | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
echo "GH_TOKEN: $GH_TOKEN" | ||
echo "GITHUB_REF: $GITHUB_REF" | ||
tag="${GITHUB_REF#refs/tags/}" | ||
gh release create "$tag" \ | ||
--title="$tag" \ | ||
main.js manifest.json styles.css | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- 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: Get plugin version | ||
id: version | ||
run: | | ||
version=$(node -p "require('./packages/plugin/manifest.json').version") | ||
echo "version=$version" >> $GITHUB_OUTPUT | ||
- name: Create Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
# Create a temporary directory for release files | ||
mkdir release | ||
cp packages/plugin/dist/main.js release/ | ||
cp packages/plugin/dist/styles.css release/ | ||
cp packages/plugin/manifest.json release/ | ||
# Create release notes from git log | ||
git log --pretty=format:"- %s" $(git describe --tags --abbrev=0 HEAD^)..HEAD > release/notes.md | ||
# Create the release | ||
gh release create "${{ steps.version.outputs.version }}" \ | ||
--title="Version ${{ steps.version.outputs.version }}" \ | ||
--notes-file=release/notes.md \ | ||
--draft=false \ | ||
release/main.js \ | ||
release/styles.css \ | ||
release/manifest.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Build Obsidian Plugin | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'packages/plugin/**' | ||
pull_request: | ||
paths: | ||
- 'packages/plugin/**' | ||
|
||
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: | | ||
cd packages/plugin | ||
pnpm install | ||
- name: Build plugin | ||
run: | | ||
cd packages/plugin | ||
GITHUB_ACTIONS=true pnpm build | ||
- name: Run tests | ||
run: | | ||
cd packages/plugin | ||
pnpm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Release Obsidian Plugin | ||
|
||
on: | ||
push: | ||
tags: | ||
- "test-*" | ||
- "*" | ||
paths: | ||
- 'packages/plugin/**' | ||
|
||
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: | | ||
cd packages/plugin | ||
pnpm install | ||
- name: Build plugin | ||
run: | | ||
cd packages/plugin | ||
GITHUB_ACTIONS=true pnpm build | ||
- name: Create release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
cd packages/plugin | ||
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 "- dist/main.js" | ||
echo "- manifest.json" | ||
echo "- dist/styles.css" | ||
# Verify files exist | ||
ls -la dist/main.js manifest.json dist/styles.css || true | ||
else | ||
gh release create "${GITHUB_REF#refs/tags/}" \ | ||
--title="${GITHUB_REF#refs/tags/}" \ | ||
--draft=false \ | ||
--prerelease=false \ | ||
dist/main.js manifest.json dist/styles.css | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Build output | ||
dist/ | ||
|
||
# Development output | ||
main.js | ||
styles.css | ||
data.json |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"id": "fileorganizer2000", | ||
"name": "AI File Organizer 2000", | ||
"version": "1.132.0", | ||
"minAppVersion": "0.15.0", | ||
"description": "An AI assistant to organize and chat with your vault", | ||
"author": "Benjamin Ashgan Shafii", | ||
"isDesktopOnly": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters