-
Notifications
You must be signed in to change notification settings - Fork 15
71 lines (59 loc) · 1.96 KB
/
Copy pathrelease.yml
File metadata and controls
71 lines (59 loc) · 1.96 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
66
67
68
69
70
71
name: 🚀 Release
on:
workflow_dispatch:
permissions:
id-token: write
contents: write
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Verify main branch
run: |
if [[ "${{ github.ref_name }}" != "main" ]]; then
echo "Release can only be done on the main branch."
exit 1
fi
- name: Checkout project
uses: actions/checkout@v6
- name: Install Mise
uses: caido/action-mise-action@v3.2.0
with:
working_directory: .
version: ${{ vars.CI__MISE_VERSION }}
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build package
run: pnpm build
- name: Sign package
working-directory: dist
run: |
if [[ -z "${{ secrets.PRIVATE_KEY }}" ]]; then
echo "Set an ed25519 key as PRIVATE_KEY in GitHub Action secret to sign."
exit 1
else
echo "${{ secrets.PRIVATE_KEY }}" > private_key.pem
openssl pkeyutl -sign -inkey private_key.pem -out plugin_package.zip.sig -rawin -in plugin_package.zip
rm private_key.pem
fi
- name: Check version
id: meta
working-directory: dist
run: |
VERSION=$(unzip -p plugin_package.zip manifest.json | jq -r .version)
echo "version=${VERSION}" >> $GITHUB_OUTPUT
- name: Publish package
working-directory: packages/shared
run: |
pnpm run build
npm pkg set "version=${{ steps.meta.outputs.version }}"
npm publish --access public --provenance
- name: Create release
uses: caido/action-release@v1
with:
tag: ${{ steps.meta.outputs.version }}
commit: ${{ github.sha }}
body: 'Release ${{ steps.meta.outputs.version }}'
artifacts: 'dist/plugin_package.zip,dist/plugin_package.zip.sig'
immutableCreate: true