Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Commit 18d8c60

Browse files
committed
update action release
1 parent a0f2a41 commit 18d8c60

File tree

1 file changed

+57
-12
lines changed

1 file changed

+57
-12
lines changed

.github/workflows/release.yml

Lines changed: 57 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,70 @@
1-
name: Plugin release
2-
1+
name: Release Obsidian Plugin
32
on:
43
push:
54
tags:
65
- "*"
7-
86
jobs:
97
build:
10-
runs-on: self-hosted
8+
runs-on: ubuntu-latest
119
steps:
12-
- uses: actions/checkout@v2
13-
- uses: denolib/setup-deno@v2
10+
- uses: actions/checkout@v3
1411
with:
15-
deno-version: v1.x
16-
- name: npm build
12+
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
13+
- name: Use Node.js
14+
uses: actions/setup-node@v3
15+
with:
16+
node-version: 16
17+
- name: Get Version
18+
id: version
19+
run: |
20+
echo "::set-output name=tag::$(git describe --abbrev=0)"
21+
- name: Build
22+
id: build
1723
run: |
1824
npm install
1925
npm run build -- --environment BUILD:production
26+
# Create the release on github
2027
- name: Create Release
21-
# https://github.com/ncipollo/release-action
22-
uses: ncipollo/[email protected]
28+
id: create_release
29+
uses: actions/create-release@v1
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
VERSION: ${{ github.ref }}
33+
with:
34+
tag_name: ${{ github.ref }}
35+
release_name: ${{ github.ref }}
36+
draft: false
37+
prerelease: false
38+
# Upload the main.js
39+
- name: Upload main.js
40+
id: upload-main
41+
uses: actions/upload-release-asset@v1
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
with:
45+
upload_url: ${{ steps.create_release.outputs.upload_url }}
46+
asset_path: ./dist/main.js
47+
asset_name: main.js
48+
asset_content_type: text/javascript
49+
# Upload the manifest.json
50+
- name: Upload manifest.json
51+
id: upload-manifest
52+
uses: actions/upload-release-asset@v1
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
with:
56+
upload_url: ${{ steps.create_release.outputs.upload_url }}
57+
asset_path: ./manifest.json
58+
asset_name: manifest.json
59+
asset_content_type: application/json
60+
# Upload the style.css
61+
- name: Upload styles.css
62+
id: upload-css
63+
uses: actions/upload-release-asset@v1
64+
env:
65+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2366
with:
24-
artifacts: "dist/main.js,manifest.json,styles.css"
25-
token: ${{ secrets.GITHUB_TOKEN }}
67+
upload_url: ${{ steps.create_release.outputs.upload_url }}
68+
asset_path: ./styles.css
69+
asset_name: styles.css
70+
asset_content_type: text/css

0 commit comments

Comments
 (0)