Skip to content

Commit f3ffa86

Browse files
committed
add actions
1 parent 08e4a54 commit f3ffa86

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

.github/workflows/release.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: 🚀 Release
2+
3+
on:
4+
workflow_dispatch:
5+
6+
env:
7+
NODE_VERSION: 20
8+
PNPM_VERSION: 9
9+
10+
jobs:
11+
release:
12+
name: Release
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
17+
steps:
18+
- name: Checkout project
19+
uses: actions/checkout@v4
20+
21+
- name: Check version
22+
id: meta
23+
run: |
24+
VERSION=$(jq -r .version manifest.json)
25+
echo "version=${VERSION}" >> $GITHUB_OUTPUT
26+
27+
- name: Setup Node.js
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: ${{ env.NODE_VERSION }}
31+
32+
- name: Setup pnpm
33+
uses: pnpm/action-setup@v4
34+
with:
35+
version: ${{ env.PNPM_VERSION }}
36+
run_install: true
37+
38+
- name: Build package
39+
run: pnpm build
40+
41+
- name: Sign package
42+
working-directory: dist
43+
run: |
44+
if [[ -z "${{ secrets.PRIVATE_KEY }}" ]]; then
45+
echo "Set an ed25519 key as PRIVATE_KEY in GitHub Action secret to sign."
46+
else
47+
echo "${{ secrets.PRIVATE_KEY }}" > private_key.pem
48+
openssl pkeyutl -sign -inkey private_key.pem -out plugin_package.zip.sig -rawin -in plugin_package.zip
49+
rm private_key.pem
50+
fi
51+
52+
- name: Create release
53+
uses: ncipollo/release-action@v1
54+
with:
55+
tag: ${{ steps.meta.outputs.version }}
56+
commit: ${{ github.sha }}
57+
body: 'Release ${{ steps.meta.outputs.version }}'
58+
artifacts: 'dist/plugin_package.zip,dist/plugin_package.zip.sig'

0 commit comments

Comments
 (0)