-
-
Notifications
You must be signed in to change notification settings - Fork 31
58 lines (49 loc) · 1.81 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
51
52
53
54
55
56
57
58
name: Release Obsidian plugin
on:
pull_request_target:
types:
- closed
branches:
- main
permissions:
contents: write
pull-requests: write
jobs:
release:
if: ${{ github.event.pull_request.merged == true && github.head_ref == 'develop' && github.event.pull_request.author_association == 'OWNER' }}
runs-on: ubuntu-latest
steps:
- name: Print github
run: echo '${{ toJson(github) }}'
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "18.x"
- name: Build plugin main.js
id: build_plugin
run: |
git config core.autocrlf false
git config core.eol lf
npm ci
npm run build
TAG_NAME=$(node -p "require('./package.json').version")
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
- name: Create release
uses: softprops/action-gh-release@v1
with:
files: |
main.js
manifest.json
styles.css
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ env.TAG_NAME }}
prerelease: false
draft: false
- name: Create and merge pull request from main to develop
run: |
gh pr create -B develop -H main --title 'Merge main into develop' --body 'Merge main into develop'
gh pr merge main --merge --auto --body 'Merge main into develop'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}