-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (46 loc) · 1.42 KB
/
release.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
name: Build and Release
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install dependencies
run: pnpm install
- name: Install jq
uses: dcarbone/install-jq-action@v2
- name: Update manifest version
run: |
release_version=${{ github.event.release.tag_name }}
jq --arg version "$release_version" '.version = $version' manifest.json > manifest.temp.json
mv manifest.temp.json manifest.json
- name: Build the project
run: pnpm build
- name: Compress build folder
run: zip -r shortcut-click-extension.zip manifest.json dist/* icons/* public/*
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: shortcut-click-extension
path: shortcut-click-extension.zip
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: shortcut-click-extension.zip
asset_name: shortcut-click-extension.zip
asset_content_type: application/zip