-
-
Notifications
You must be signed in to change notification settings - Fork 34
60 lines (51 loc) · 1.94 KB
/
publish.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
59
60
name: Publish plugin
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get package values
uses: jarrettmeyer/github-action-package-values@v1
id: package
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'
- name: Install dependencies
run: yarn
- name: Build
id: build
run: |
yarn run build
mkdir ${{ steps.package.outputs.package_name }}
cp README.md package.json icon.png ${{ steps.package.outputs.package_name }}
mv dist ${{ steps.package.outputs.package_name }}
cd ${{ steps.package.outputs.package_name }}
zip -r ${{ steps.package.outputs.package_name }}.zip *
cd ..
mv ${{ steps.package.outputs.package_name }}/${{ steps.package.outputs.package_name }}.zip ./
echo "::set-output name=tag_name::$(git tag --sort version:refname | tail -n 1)"
- name: Create Release
uses: ncipollo/release-action@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: v${{ steps.package.outputs.package_version }}
with:
allowUpdates: false
draft: true
prerelease: false
generateReleaseNotes: true
tag: v${{ steps.package.outputs.package_version }}
- name: Upload zip file
id: upload_zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ steps.package.outputs.package_name }}.zip
asset_name: ${{ steps.package.outputs.package_name }}-v${{ steps.package.outputs.package_version }}.zip
asset_content_type: application/zip