Skip to content

Commit 13f464d

Browse files
committed
UPD Manifest, release workflow
1 parent 33839b2 commit 13f464d

File tree

5 files changed

+73
-25
lines changed

5 files changed

+73
-25
lines changed

.github/workflows/release.yml

Lines changed: 61 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,87 @@
1+
name: Release Obsidian plugin
2+
13
on:
24
push:
3-
# Sequence of patterns matched against refs/tags
45
tags:
5-
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
6+
- "*"
67

7-
name: Upload Release Asset
8+
env:
9+
PLUGIN_NAME: your-plugin-id # Change this to match the id of your plugin.
810

911
jobs:
1012
build:
11-
name: Upload Release Asset
12-
environment: production
1313
runs-on: ubuntu-latest
14+
1415
steps:
15-
- name: Checkout code
16-
uses: actions/checkout@v2
17-
- name: Build project # This would actually build your project, using zip for an example artifact
16+
- uses: actions/checkout@v2
17+
- name: Use Node.js
18+
uses: actions/setup-node@v1
19+
with:
20+
node-version: "16.x"
21+
22+
- name: Build
23+
id: build
1824
run: |
19-
zip --junk-paths my-artifact README.md
25+
npm install
26+
npm run build
27+
mkdir ${{ env.PLUGIN_NAME }}
28+
cp main.js manifest.json styles.css ${{ env.PLUGIN_NAME }}
29+
zip -r ${{ env.PLUGIN_NAME }}.zip ${{ env.PLUGIN_NAME }}
30+
ls
31+
echo "::set-output name=tag_name::$(git tag --sort version:refname | tail -n 1)"
32+
2033
- name: Create Release
2134
id: create_release
2235
uses: actions/create-release@v1
2336
env:
2437
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
VERSION: ${{ github.ref }}
2539
with:
2640
tag_name: ${{ github.ref }}
27-
release_name: Release ${{ github.ref }}
41+
release_name: ${{ github.ref }}
2842
draft: false
2943
prerelease: false
30-
- name: Upload Release Asset
31-
id: upload-release-asset
44+
45+
- name: Upload zip file
46+
id: upload-zip
3247
uses: actions/upload-release-asset@v1
3348
env:
3449
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3550
with:
36-
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
37-
asset_path: ./my-artifact.zip
38-
asset_name: my-artifact.zip
51+
upload_url: ${{ steps.create_release.outputs.upload_url }}
52+
asset_path: ./${{ env.PLUGIN_NAME }}.zip
53+
asset_name: ${{ env.PLUGIN_NAME }}-${{ steps.build.outputs.tag_name }}.zip
3954
asset_content_type: application/zip
4055

56+
- name: Upload main.js
57+
id: upload-main
58+
uses: actions/upload-release-asset@v1
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
with:
62+
upload_url: ${{ steps.create_release.outputs.upload_url }}
63+
asset_path: ./main.js
64+
asset_name: main.js
65+
asset_content_type: text/javascript
4166

67+
- name: Upload manifest.json
68+
id: upload-manifest
69+
uses: actions/upload-release-asset@v1
70+
env:
71+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72+
with:
73+
upload_url: ${{ steps.create_release.outputs.upload_url }}
74+
asset_path: ./manifest.json
75+
asset_name: manifest.json
76+
asset_content_type: application/json
77+
78+
- name: Upload styles.css
79+
id: upload-css
80+
uses: actions/upload-release-asset@v1
81+
env:
82+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
83+
with:
84+
upload_url: ${{ steps.create_release.outputs.upload_url }}
85+
asset_path: ./styles.css
86+
asset_name: styles.css
87+
asset_content_type: text/css

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ A plugin for [Obsidian](https://obsidian.md) which allows editing of mdx, sdx fi
55
[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/git-no/obsidian-markdown-suffix?style=for-the-badge&sort=semver)](https://github.com/git-no/obsidian-markdown-suffix/releases/latest)
66
![GitHub All Releases](https://img.shields.io/github/downloads/git-no/obsidian-markdown-suffix/total?style=for-the-badge)
77

8+
[![Upload Release Asset](https://github.com/git-no/obsidian-markdown-suffix/actions/workflows/release.yml/badge.svg)](https://github.com/git-no/obsidian-markdown-suffix/actions/workflows/release.yml)
9+
810
## Installation
911

1012
Install as a regular [Community plugin](https://help.obsidian.md/Advanced+topics/Community+plugins).

manifest.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"id": "obsidian-sample-plugin",
3-
"name": ".mdx, svx as markdown",
2+
"id": "obsidian-markdown-file-suffix",
3+
"name": "Addional Markdown suffix (.mdx/.svx).",
44
"version": "1.0.0",
55
"minAppVersion": "0.10.12",
6-
"description": "A plugin for [Obsidian](https://obsidian.md) which allows editing of mdx, sdx files as if they were markdown.",
7-
"author": "git-no",
8-
"authorUrl": "https://github.com/git-no",
6+
"description": "Use additional files like .mdx / .svx as if they were markdown.",
7+
"author": "swissmation",
8+
"authorUrl": "https://github.com/swissmation",
99
"isDesktopOnly": false
1010
}

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "obsidian-markdown-suffix",
2+
"name": "obsidian-markdown-file-suffix",
33
"version": "1.0.0",
44
"description": "A plugin for [Obsidian](https://obsidian.md) which allows editing of mdx, sdx files as if they were markdown.",
55
"main": "main.js",
@@ -8,8 +8,8 @@
88
"build": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production",
99
"version": "node version-bump.mjs && git add manifest.json versions.json"
1010
},
11-
"keywords": [],
12-
"author": "",
11+
"keywords": ["obsidian","plugin","mdx-svx-obsidian"],
12+
"author": "swissmation",
1313
"license": "MIT",
1414
"devDependencies": {
1515
"@types/node": "^16.11.6",

versions.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"1.0.0": "0.15.0"
3-
}
2+
"1.0.0": "0.10.12"
3+
}

0 commit comments

Comments
 (0)