Skip to content

Commit 80f8129

Browse files
committed
add github workflows
1 parent 085c046 commit 80f8129

File tree

5 files changed

+163
-0
lines changed

5 files changed

+163
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
- [ ] The Plugin is up to date
10+
- [ ] Obsidian is up to date
11+
12+
**Describe the bug**
13+
A clear and concise description of what the bug is.
14+
15+
**To Reproduce**
16+
Steps to reproduce the behavior:
17+
18+
1. Go to '...'
19+
2. Click on '....'
20+
3. Scroll down to '....'
21+
4. See error
22+
23+
**Expected behavior**
24+
A clear and concise description of what you expected to happen.
25+
26+
**Screenshots**
27+
If applicable, add screenshots to help explain your problem.
28+
29+
**Occurs on**
30+
31+
- [ ] Windows
32+
- [ ] macOS
33+
- [ ] Linux
34+
- [ ] Android
35+
- [ ] iOS
36+
37+
**Plugin version**
38+
x.x.x
39+
40+
**Additional context**
41+
Add any other context about the problem here.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: feature request
6+
assignees: ''
7+
---
8+
9+
**Is your feature request related to a problem? Please describe.**
10+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
11+
12+
**Describe the solution you'd like**
13+
A clear and concise description of what you want to happen.
14+
15+
**Additional context**
16+
Add any other context or screenshots about the feature request here.

.github/workflows/closeIssue.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Close Invalid Issue
2+
on:
3+
issues:
4+
types:
5+
- labeled
6+
jobs:
7+
closeIssue:
8+
if: github.event.label.name == 'invalid'
9+
runs-on: ubuntu-latest
10+
permissions:
11+
issues: write
12+
steps:
13+
- name: Close Issue
14+
uses: peter-evans/close-issue@v2
15+
with:
16+
comment: This issue is invalid. Please conform to the issue templates.
17+
close-reason: not_planned

.github/workflows/release.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Build Obsidian Plugin
2+
3+
# adapted from https://github.com/argenos/nldates-obsidian/blob/master/.github/workflows/release.yml
4+
5+
on:
6+
push:
7+
# Sequence of patterns matched against refs/tags
8+
tags:
9+
- '*' # Push events to matching any tag format, i.e. 1.0, 20.15.10
10+
11+
env:
12+
PLUGIN_NAME: lemons-plugin-template # Change this to the name of your plugin-id folder
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v3
20+
- uses: oven-sh/setup-bun@v1
21+
with:
22+
bun-version: latest
23+
- name: Build
24+
id: build
25+
run: |
26+
bun install
27+
bun run build
28+
mkdir ${{ env.PLUGIN_NAME }}
29+
cp main.js manifest.json styles.css ${{ env.PLUGIN_NAME }}
30+
zip -r ${{ env.PLUGIN_NAME }}.zip ${{ env.PLUGIN_NAME }}
31+
ls
32+
echo "tag_name=$(git tag --sort version:refname | tail -n 1)" >> $GITHUB_OUTPUT
33+
34+
- name: Create Release
35+
id: create_release
36+
uses: actions/create-release@v1
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
VERSION: ${{ github.ref }}
40+
with:
41+
tag_name: ${{ github.ref }}
42+
release_name: ${{ github.ref }}
43+
draft: false
44+
prerelease: false
45+
46+
- name: Upload zip file
47+
id: upload-zip
48+
uses: actions/upload-release-asset@v1
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
with:
52+
upload_url: ${{ steps.create_release.outputs.upload_url }}
53+
asset_path: ./${{ env.PLUGIN_NAME }}.zip
54+
asset_name: ${{ env.PLUGIN_NAME }}-${{ steps.build.outputs.tag_name }}.zip
55+
asset_content_type: application/zip
56+
57+
- name: Upload main.js
58+
id: upload-main
59+
uses: actions/upload-release-asset@v1
60+
env:
61+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62+
with:
63+
upload_url: ${{ steps.create_release.outputs.upload_url }}
64+
asset_path: ./main.js
65+
asset_name: main.js
66+
asset_content_type: text/javascript
67+
68+
- name: Upload manifest.json
69+
id: upload-manifest
70+
uses: actions/upload-release-asset@v1
71+
env:
72+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73+
with:
74+
upload_url: ${{ steps.create_release.outputs.upload_url }}
75+
asset_path: ./manifest.json
76+
asset_name: manifest.json
77+
asset_content_type: application/json
78+
79+
- name: Upload styles.css
80+
id: upload-css
81+
uses: actions/upload-release-asset@v1
82+
env:
83+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
84+
with:
85+
upload_url: ${{ steps.create_release.outputs.upload_url }}
86+
asset_path: ./styles.css
87+
asset_name: styles.css
88+
asset_content_type: text/css

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Things to change Checklist:
1010
- [ ] `package.json`
1111
- [ ] `versions.json`
1212
- [ ] `automation/config.js`
13+
- [ ] `.github/workflows/release.yml`
1314
- [ ] rename `exampleVault/.obsidian/lemons-plugin-template`
1415

1516
If and **only if** you completed these steps, you can run `bun install` and `bun run dev` to start your plugin jorney.

0 commit comments

Comments
 (0)