-
Notifications
You must be signed in to change notification settings - Fork 17
99 lines (85 loc) · 3.23 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: docFiller Release
on:
push:
tags:
- "*"
permissions:
contents: write
jobs:
build:
name: Build and Release
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Zip Source Code
run: |
zip -r docFiller.zip . -x '*.git*' -x '*node_modules*' -x '*build*' -x '*coverage*' -x '*web-ext-artifacts*'
- name: Extract Version from Tag
run: |
VERSION=${GITHUB_REF#refs/tags/}
MINIFIED_VERSION=${VERSION#v}
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "MINIFIED_VERSION=$MINIFIED_VERSION" >> $GITHUB_ENV
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Installation of Dependencies
run: |
bun install
- name: Package extension
run: |
bun run package:firefox
bun run package:chromium
- name: Assemble release notes
run: |
> release.body.txt
VERSION_PATTERN="## ${VERSION}"
START_LINE=$(grep -n "$VERSION_PATTERN" CHANGELOG.md | cut -d: -f1 || echo "")
if [ -n "$START_LINE" ]; then
NEXT_VERSION_LINE=$(($(tail -n +$((START_LINE+1)) CHANGELOG.md | grep -n "^## " | head -n1 | cut -d: -f1 || echo "") + START_LINE))
if [ -n "$NEXT_VERSION_LINE" ]; then
sed -n "$START_LINE,$((NEXT_VERSION_LINE-1))p" CHANGELOG.md > release.body.txt
else
sed -n "$START_LINE,\$p" CHANGELOG.md > release.body.txt
fi
fi
- name: Create GitHub Release
id: create_release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.VERSION }}
name: ${{ env.VERSION }}
draft: false
prerelease: false
body_path: release.body.txt
files: |
web-ext-artifacts/docfiller-*.zip
- uses: wdzeng/chrome-extension@v1
with:
extension-id: goibiampjlgcdjdfakjepniopldpijcd
zip-path: web-ext-artifacts/docfiller-${{ env.MINIFIED_VERSION }}-chromium.zip
client-id: ${{ secrets.CHROME_CLIENT_ID }}
client-secret: ${{ secrets.CHROME_CLIENT_SECRET }}
refresh-token: ${{ secrets.CHROME_REFRESH_TOKEN }}
continue-on-error: true
- uses: wdzeng/firefox-addon@v1
with:
addon-guid: "[email protected]"
xpi-path: web-ext-artifacts/docfiller-${{ env.MINIFIED_VERSION }}-firefox.zip
self-hosted: false
jwt-issuer: ${{ secrets.FIREFOX_AUTH_API_ISSUER }}
jwt-secret: ${{ secrets.FIREFOX_AUTH_API_SECRET }}
approval-notes: "Available at https://github.com/rootCircle/docFiller/blob/dev/docs/FOR_ADDONS_REVIEWERS.md"
continue-on-error: true
- uses: wdzeng/edge-addon@v2
with:
product-id: 4dfc1366-555a-431e-91d1-9991bc771fab
zip-path: web-ext-artifacts/docfiller-${{ env.MINIFIED_VERSION }}-chromium.zip
api-key: ${{ secrets.EDGE_API_KEY }}
client-id: ${{ secrets.EDGE_CLIENT_ID }}
continue-on-error: true