-
Notifications
You must be signed in to change notification settings - Fork 2
65 lines (56 loc) · 2.26 KB
/
Copy pathprod-release.yml
File metadata and controls
65 lines (56 loc) · 2.26 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
57
58
59
60
61
62
63
64
65
name: PROD Plugin Release
on:
push:
branches:
- main
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: '24'
cache: 'yarn'
- name: Install dependencies
run: yarn install --immutable --prefer-offline
- name: Build and test frontend
id: build
run: yarn build
- name: Get plugin metadata
id: metadata
run: |
sudo apt-get install jq
export KENSOBI_PLUGIN_ID=$(cat dist/plugin.json | jq -r .id)
export KENSOBI_PLUGIN_VERSION=$(cat dist/plugin.json | jq -r .info.version)
export KENSOBI_PLUGIN_TYPE=$(cat dist/plugin.json | jq -r .type)
export KENSOBI_PLUGIN_ARTIFACT=${KENSOBI_PLUGIN_ID}-${KENSOBI_PLUGIN_VERSION}.zip
export KENSOBI_PLUGIN_ARTIFACT_CHECKSUM=${KENSOBI_PLUGIN_ARTIFACT}.md5
echo "plugin-id=${KENSOBI_PLUGIN_ID}" >> $GITHUB_OUTPUT
echo "plugin-version=${KENSOBI_PLUGIN_VERSION}" >> $GITHUB_OUTPUT
echo "plugin-type=${KENSOBI_PLUGIN_TYPE}" >> $GITHUB_OUTPUT
echo "archive=${KENSOBI_PLUGIN_ARTIFACT}" >> $GITHUB_OUTPUT
echo "archive-checksum=${KENSOBI_PLUGIN_ARTIFACT_CHECKSUM}" >> $GITHUB_OUTPUT
echo "github-tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Package plugin
id: package-plugin
run: |
mv dist ${{ steps.metadata.outputs.plugin-id }}
zip ${{ steps.metadata.outputs.archive }} ${{ steps.metadata.outputs.plugin-id }} -r
md5sum ${{ steps.metadata.outputs.archive }} > ${{ steps.metadata.outputs.archive-checksum }}
echo "checksum=$(cat ./${{ steps.metadata.outputs.archive-checksum }} | cut -d' ' -f1)" >> $GITHUB_OUTPUT
- name: Create Github release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.metadata.outputs.plugin-version }}
draft: false
generate_release_notes: true
files: |
./${{ steps.metadata.outputs.archive }}
./${{ steps.metadata.outputs.archive-checksum }}
body: |
Release notes