-
Notifications
You must be signed in to change notification settings - Fork 2
50 lines (46 loc) · 1.35 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
name: Release Obsidian plugin
on:
workflow_dispatch:
push:
branches:
- master
paths:
- "manifest.json"
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "18.x"
cache: "yarn"
- run: yarn install --frozen-lockfile
- id: set_var
run: |
content=`cat ./manifest.json`
# the following lines are only required for multi line json
content="${content//'%'/'%25'}"
content="${content//$'\n'/'%0A'}"
content="${content//$'\r'/'%0D'}"
# end of optional handling for multi line json
echo "::set-output name=manifestJson::$content"
- name: Build plugin
run: yarn build
- name: 'Zip files'
uses: montudor/action-zip@v1
with:
args: "zip -qq -r emera-${{fromJson(steps.set_var.outputs.manifestJson).version}}.zip main.js manifest.json styles.css"
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: "${{fromJson(steps.set_var.outputs.manifestJson).version}}"
generate_release_notes: false
files: |
*.zip
manifest.json
main.js
styles.css