chore: download signed Firefox

This commit is contained in:
Xmader 2020-10-30 17:32:58 -04:00
parent b247367d8e
commit 949c27fea9
2 changed files with 29 additions and 2 deletions

21
.github/workflows/get-signed-ext.sh vendored Normal file
View file

@ -0,0 +1,21 @@
API_URL=https://addons.mozilla.org/api/v4/addons/addon/$EXT_ID/versions/
# wait for maximum 15 min
for i in {1..15}
do
url=$(\
wget -q $API_URL -O - | \
jq -r ".results[] | select(.version==\"$VERSION\") | .files[0].url" \
)
if [ -n "$url" ]; then
echo "v$VERSION available!"
wget -nv $url
exit
else
echo "v$VERSION unavailable"
fi
sleep 1m
done

View file

@ -60,6 +60,9 @@ jobs:
apiKey: ${{ secrets.AMO_SIGN_KEY }}
apiSecret: ${{ secrets.AMO_SIGN_SECRET }}
- run: sh ./.github/workflows/get-signed-ext.sh
env:
EXT_ID: musescore-downloader
- run: |
cp dist/main.js musescore-downloader.user.js && \
cp dist/ext.zip musescore-downloader.webextension.zip
@ -67,9 +70,12 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
files=$(ls musescore?downloader*)
assets=()
for f in $files; do [ -f "$f" ] && assets+=(-a "$f"); done
hub release create \
-a "musescore-downloader.user.js" \
-a "musescore-downloader.webextension.zip" \
"${assets[@]}" \
-m v$VERSION \
-t $REF \
v$VERSION