generated from obsidianmd/obsidian-sample-plugin
-
Notifications
You must be signed in to change notification settings - Fork 3
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
c3d2e61
commit 21c2fda
Showing
7 changed files
with
84 additions
and
28 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
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,27 @@ | ||
name: 'Node setup and cache' | ||
description: 'Setup Node.js packages and restore cache' | ||
|
||
inputs: | ||
node-version: | ||
description: 'Node version to use, default to 20' | ||
required: true | ||
default: '20' | ||
outputs: | ||
cache-hit: | ||
description: 'Forward actions/cache cache-hit output' | ||
value: ${{ steps.node-cache.outputs.cache-hit }} | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: ⚙️ Setup node.js ${{ inputs.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ inputs.node-version }} | ||
|
||
- name: 📦 Cache node modules | ||
id: node-cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: node_modules | ||
key: node-modules-${{ inputs.node-version }}-${{ hashFiles('package-lock.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 |
---|---|---|
@@ -1,34 +1,61 @@ | ||
name: Release Obsidian plugin | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
name: Release Obsidian Plugin | ||
on: [push] | ||
|
||
concurrency: | ||
group: ${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
node-setup: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/node-cache | ||
id: cache-node-modules | ||
with: | ||
node-version: '20' | ||
- run: npm i | ||
if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
|
||
run-lint: | ||
name: ✅ Linter | ||
needs: node-setup | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
- uses: ./.github/actions/node-cache | ||
id: cache-node-modules | ||
with: | ||
node-version: "18.x" | ||
node-version: '20' | ||
|
||
- name: Build plugin | ||
run: | | ||
npm install | ||
npm run build | ||
- name: ✅ Run code style linter | ||
id: linter | ||
run: npm run lint | ||
|
||
release-plugin: | ||
name: 📦 Release Obsidian Plugin | ||
needs: run-lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/node-cache | ||
id: cache-node-modules | ||
with: | ||
node-version: '20' | ||
|
||
- name: 📗 Build plugin | ||
id: build_plugin | ||
if: steps.cache-node-modules.outcome == 'success' | ||
run: npm run build | ||
|
||
- name: Create release | ||
- name: 📦 Create release | ||
if: steps.build_plugin.outcome == 'success' && contains(github.ref, 'refs/tags/') | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
tag="${GITHUB_REF#refs/tags/}" | ||
tag='${GITHUB_REF#refs/tags/}' | ||
gh release create "$tag" \ | ||
--title="$tag" \ | ||
gh release create '$tag' \ | ||
--title='$tag' \ | ||
--draft \ | ||
main.js manifest.json styles.css |
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
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 |
---|---|---|
@@ -1,7 +1,3 @@ | ||
{ | ||
"1.0.0": "0.15.0", | ||
"1.0.1": "0.15.0", | ||
"1.0.2": "0.15.0", | ||
"1.1.0": "0.15.0", | ||
"1.1.1": "0.15.0" | ||
"1.0.0": "0.15.0" | ||
} |