-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (44 loc) · 1.37 KB
/
release.yml
File metadata and controls
53 lines (44 loc) · 1.37 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
name: Build CRX and Release
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Decode private key
run: echo "${{ secrets.CRX_PRIVATE_KEY }}" | base64 -d > key.pem
- name: Build CRX
run: |
npm install crx
node -e "
const fs = require('fs');
const path = require('path');
const ChromeExtension = require('crx');
const crx = new ChromeExtension({ privateKey: fs.readFileSync('key.pem') });
crx.load(path.resolve('.'))
.then(crx => crx.pack())
.then(buf => {
fs.writeFileSync('opencode-reader.crx', buf);
console.log('CRX built successfully');
})
.catch(e => { console.error(e); process.exit(1); });
"
- name: Clean up key
run: rm -f key.pem
- name: Get version from tag
id: version
run: echo "tag=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"
- name: Create Release
uses: softprops/action-gh-release@v2
with:
name: ${{ steps.version.outputs.tag }}
files: opencode-reader.crx
generate_release_notes: true