generated from obsidianmd/obsidian-sample-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workflow to build plugin artifact
- Loading branch information
Showing
2 changed files
with
112 additions
and
30 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 |
---|---|---|
@@ -0,0 +1,77 @@ | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
build-release: | ||
permissions: | ||
contents: write | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
|
||
- uses: pnpm/action-setup@v2 | ||
name: Install pnpm | ||
id: pnpm-install | ||
with: | ||
version: 7 | ||
run_install: false | ||
|
||
- name: Get pnpm store directory | ||
id: pnpm-cache | ||
shell: bash | ||
run: | | ||
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | ||
- uses: actions/cache@v3 | ||
name: Setup pnpm cache | ||
with: | ||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Build | ||
run: pnpm build | ||
|
||
- name: Pack | ||
run: pnpm pack | ||
|
||
# Package the required files into a zip | ||
- name: Package | ||
run: | | ||
mkdir ${{ github.event.repository.name }} | ||
cp main.js manifest.json styles.css README.md ${{ github.event.repository.name }} | ||
zip -r ${{ github.event.repository.name }}.zip ${{ github.event.repository.name }} | ||
# Create the release on github | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
VERSION: ${{ github.ref }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
|
||
# Upload zip file | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: ${{ github.event.repository.name }}.zip |
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,32 +1,37 @@ | ||
{ | ||
"name": "obsidian-journal", | ||
"version": "0.0.1", | ||
"description": "This is a sample plugin for Obsidian (https://obsidian.md)", | ||
"main": "main.js", | ||
"scripts": { | ||
"dev": "node esbuild.config.mjs", | ||
"build": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production", | ||
"version": "node version-bump.mjs && git add manifest.json versions.json" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"@types/node": "^16.11.6", | ||
"@typescript-eslint/eslint-plugin": "5.29.0", | ||
"@typescript-eslint/parser": "5.29.0", | ||
"builtin-modules": "3.3.0", | ||
"esbuild": "0.17.3", | ||
"obsidian": "latest", | ||
"tslib": "2.4.0", | ||
"typescript": "4.7.4" | ||
}, | ||
"dependencies": { | ||
"@preact/signals": "^1.1.3", | ||
"obsidian-calendar-ui": "^0.3.12", | ||
"obsidian-daily-notes-interface": "^0.9.4", | ||
"preact": "^10.13.2", | ||
"preact-render-to-string": "^6.0.2", | ||
"svelte": "^3.58.0" | ||
} | ||
"name": "obsidian-journal", | ||
"version": "0.0.1", | ||
"description": "This is a sample plugin for Obsidian (https://obsidian.md)", | ||
"main": "main.js", | ||
"scripts": { | ||
"dev": "node esbuild.config.mjs", | ||
"build": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production", | ||
"version": "node version-bump.mjs && git add manifest.json versions.json" | ||
}, | ||
"files": [ | ||
"main.js", | ||
"manifest.json", | ||
"styles.css" | ||
], | ||
"keywords": [], | ||
"author": "", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"@types/node": "^16.11.6", | ||
"@typescript-eslint/eslint-plugin": "5.29.0", | ||
"@typescript-eslint/parser": "5.29.0", | ||
"builtin-modules": "3.3.0", | ||
"esbuild": "0.17.3", | ||
"obsidian": "latest", | ||
"tslib": "2.4.0", | ||
"typescript": "4.7.4" | ||
}, | ||
"dependencies": { | ||
"@preact/signals": "^1.1.3", | ||
"obsidian-calendar-ui": "^0.3.12", | ||
"obsidian-daily-notes-interface": "^0.9.4", | ||
"preact": "^10.13.2", | ||
"preact-render-to-string": "^6.0.2", | ||
"svelte": "^3.58.0" | ||
} | ||
} |