-
Notifications
You must be signed in to change notification settings - Fork 3
56 lines (54 loc) · 1.81 KB
/
node-build-release.yml
File metadata and controls
56 lines (54 loc) · 1.81 KB
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
name: node-build-release
on:
push:
tags:
- 'v*'
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '16.20.2'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Npm publish
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
- name: Get plugin info
id: info
run: |
package_file=./package.json
manifest_file=./src/manifest.json
plugin_name=$(cat $package_file | jq -r '.name')
plugin_version=$(cat $manifest_file | jq -r '.version')
plugin_id=$(cat $manifest_file | jq -r '.id')
echo "name=${plugin_name}" >> ${GITHUB_OUTPUT}
echo "version=${plugin_version}" >> ${GITHUB_OUTPUT}
echo "id=${plugin_id}" >> ${GITHUB_OUTPUT}
- name: Create zip file
uses: vimtor/action-zip@v1.2
with:
files: ./publish/${{ steps.info.outputs.id }}.jpl
dest: ./${{ steps.info.outputs.name }}_v${{ steps.info.outputs.version }}.zip
- name: Create changeLog text
id: changelog_text
uses: dragonish/tag-changelog@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
config_file: .github/scripts/tag-changelog-config.cjs
- name: Create release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: Release ${{ steps.info.outputs.version }}
prerelease: false
draft: false
artifacts: ./${{ steps.info.outputs.name }}_v${{ steps.info.outputs.version }}.zip
body: ${{ steps.changelog_text.outputs.changes }}