-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (45 loc) · 1.26 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
name: Build obsidian plugin
permissions:
contents: write
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- '*' # Push events to matching any tag format
env:
PLUGIN_NAME: cloudatlas-o-am
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'
- name: Build
id: build
run: |
npm install
npm run build --if-present
npm run dev-build --if-present
mkdir ${{ env.PLUGIN_NAME }}
cp manifest.json dist/
cp styles.css dist/
cp README.md dist/
cp dist/main.js dist/manifest.json dist/styles.css dist/README.md ${{ env.PLUGIN_NAME }}
zip -r ${{ env.PLUGIN_NAME }}.zip ${{ env.PLUGIN_NAME }}
ls dist/
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
tag="${GITHUB_REF#refs/tags/}"
gh release create "$tag" \
--title="$tag" \
--draft \
dist/styles.css \
dist/main-debug.js \
dist/main.js \
dist/manifest.json \
${{ env.PLUGIN_NAME }}.zip