-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublish-release
executable file
·57 lines (41 loc) · 1.57 KB
/
publish-release
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
#!/bin/bash
# Sane error handling
# See <https://stackoverflow.com/a/821419/15920018>
set -Eeuo pipefail
echo "Releasing hunter-extension v$1..."
# Move jj bookmarks
jj bookmark set dev main -r @-
# Push to git
git switch dev && git push
git switch main && git push
### MDN release ###
echo "Starting MDN release..."
web-ext sign --api-key=$MDN_AMO_API_KEY --api-secret=$MDN_AMO_API_SECRET --channel=unlisted
### Chrome release ###
echo "Starting Chrome release..."
# Copy everything to temp dir
rm -rf ~/Desktop/hunter-extension
cp -r ./ ~/Desktop/hunter-extension
echo "Copied files to ~/Desktop/hunter-extension"
# Remove unwanted files/dirs
rm -rf ~/Desktop/hunter-extension/.git
rm -rf ~/Desktop/hunter-extension/.jj
rm -rf ~/Desktop/hunter-extension/web-ext-artifacts
rm ~/Desktop/hunter-extension/.amo-upload-uuid
rm ~/Desktop/hunter-extension/publish-release
echo "Removed git, jj, and amo files/dirs."
# zip it
# See ditto man page (this is very similar to Finder compress function)
ditto -c -k --sequesterRsrc --keepParent ~/Desktop/hunter-extension ~/Desktop/hunter-extension.zip
rm -rf ~/Desktop/hunter-extension
echo "Zipped into ~/Desktop/hunter-extension.zip"
### Github release ###
echo "Starting Github release"
gh release create "v$1" --generate-notes -F ./CHANGELOG.md
# Upload files
cp "./web-ext-artifacts/65a14653bc7c4e6ab617-$1.xpi" ~/Desktop/65a14653bc7c4e6ab617.xpi
gh release upload "v$1" ~/Desktop/65a14653bc7c4e6ab617.xpi
gh release upload "v$1" ~/Desktop/hunter-extension.zip
# Clean up
rm ~/Desktop/65a14653bc7c4e6ab617.xpi
rm ~/Desktop/hunter-extension.zip