generated from obsidianmd/obsidian-sample-plugin
-
Notifications
You must be signed in to change notification settings - Fork 2
83 lines (73 loc) · 2.08 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Release Obsidian Plugin
on: [push]
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
node-setup:
name: ⚙️ Setup Node.js
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@v4
- uses: ./.github/actions/node-cache
id: cache-node-modules
with:
node-version: '20'
- name: ✅ Run code style linter
id: linter
run: npm run lint
run-tests:
name: 🧪 Tests
needs: node-setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/node-cache
id: cache-node-modules
with:
node-version: '20'
- name: 🧪 Run tests
id: tests
run: npm run coverage
- name: 📈 Send test coverage to Coveralls
id: coverage
if: steps.tests.outcome == 'success'
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
release-plugin:
name: 📦 Release Obsidian Plugin
needs: [run-lint, run-tests]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- 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
uses: softprops/action-gh-release@v1
if: steps.build_plugin.outcome == 'success' && contains(github.ref, 'refs/tags/')
with:
body: 'This release was generated automatically. Full details will be available soon'
draft: true
files: |
main.js
manifest.json
styles.css