generated from obsidianmd/obsidian-sample-plugin
-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (48 loc) · 1.66 KB
/
release.yaml
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
name: Release Obsidian Plugin
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- "*" # Push events to matching any tag format, i.e. 1.0, 20.15.10
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
- uses: actions/setup-node@v3
with:
node-version: "18.x" # You might need to adjust this value to your own version
# Build the plugin
- name: Build
run: |
yarn
yarn run build
# Get the version number and put it in a variable
- name: Get version info
id: version
run: |
echo "name=$(git describe --abbrev=0 --tags)" >> $GITHUB_OUTPUT
# Package the required files into a zip
- name: Package plugin archive
run: |
mkdir ${{ github.event.repository.name }}
cp main.js manifest.json README.md ${{ github.event.repository.name }}
zip -r ${{ github.event.repository.name }}-${{ steps.version.outputs.name }}.zip ${{ github.event.repository.name }}
# Create the release on github
- name: Create release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
files: |
${{ github.event.repository.name }}-${{ steps.version.outputs.name }}.zip
main.js
manifest.json
name: ${{ steps.version.outputs.name }}
prerelease: false
tag_name: ${{ github.ref }}
token: ${{ secrets.GITHUB_TOKEN }}