Skip to content

Commit

Permalink
workflow: display pluging info for nix
Browse files Browse the repository at this point in the history
  • Loading branch information
mahmoudk1000 committed Nov 2, 2024
1 parent 7e0ede3 commit 5a60624
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
name: Build
name: Releases
on:
push:
branches: ["main"]
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -27,25 +27,35 @@ jobs:
sed -i 's/const key = "";/const key = "${{ secrets.KEY }}";/' js/weather.js
sed -i 's/const latitude = 0;/const latitude = ${{ secrets.LATITUDE }};/' js/weather.js
sed -i 's/const longitude = 0;/const longitude = ${{ secrets.LONGITUDE }};/' js/weather.js
- name: Build and Sign extension
- name: Build and Sign Extension
id: build
env:
FIREFOX_JWT_ISSUER: ${{ secrets.FIREFOX_JWT_ISSUER }}
FIREFOX_JWT_SECRET: ${{ secrets.FIREFOX_JWT_SECRET }}
run: |
web-ext sign \
--channel=unlisted \
--api-key=$FIREFOX_JWT_ISSUER \
--api-secret=$FIREFOX_JWT_SECRET
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: firefox-extension
path: web-ext-artifacts/*.xpi
--api-secret=$FIREFOX_JWT_SECRET | tee >(cat) | \
grep "^Generated extension ID:" >> $GITHUB_ENV | \
xargs -I {} echo "EXTENSION_ID={}" >> $GITHUB_ENV
- name: Prep Artifact
run: |
mv web-ext-artifacts*.xpi web-ext-artifacts/startpage-${{ env.version }}.xpi
- name: Generate SHA-256 SRI hash for xpi file
id: generate_sri
run: |
XPI_FILE=$(ls web-ext-artifacts/*.xpi)
SHA256_HASH=$(sha256sum "$XPI_FILE" | awk '{print $1}' | xxd -r -p | base64)
echo "SRI_HASH=sha256-$SHA256_HASH" >> $GITHUB_ENV
- name: Release
uses: ncipollo/release-action@v1.14.0
with:
tag: ${{ env.version }}
artifacts: "web-ext-artifacts/*.xpi"
artifacts: web-ext-artifacts/*.xpi
allowUpdates: true
replacesArtifacts: true
token: ${{ secrets.GITHUB_TOKEN }}
body: |-
Generated extension ID: "${{ env.EXTENSION_ID }}"
SHA-256 (SRI) of xpi file: "${{ env.SRI_HASH }}"

0 comments on commit 5a60624

Please sign in to comment.