troubleshoot build workflow #6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: build chrome browser extension | |
| on: | |
| push: | |
| workflow_dispatch: | |
| env: | |
| ARTIFACT_NAME: ${{ github.ref_name == 'master' && 'sanitize-amazon' || format('sanitize-amazon_{0}_{1}', github.ref_name, github.run_started_at) }} | |
| jobs: | |
| build-chrome: | |
| name: build chrome extension | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: git checkout | |
| uses: actions/checkout@v4 | |
| - name: setup go-crx3 | |
| run: | | |
| wget https://github.com/mmadfox/go-crx3/releases/download/v1.6.0/go-crx3_1.6.0_linux_amd64.tar.gz | |
| tar xvf go-crx3_1.6.0_linux_amd64.tar.gz | |
| chmod +x go-crx3 && mv go-crx3 $HOME/.local/bin/ | |
| - name: build extension | |
| run: make build-chrome | |
| - name: upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ env.ARTIFACT_NAME }}_chrome | |
| path: "sanitize-amazon.crx" | |
| build_firefox: | |
| name: build firefox addon | |
| runs-on: ubuntu-latest | |
| env: | |
| AMO_JWT_ISSUER: ${{ secrets.AMO_JWT_ISSUER }} | |
| AMO_JWT_SECRET: ${{ secrets.AMO_JWT_SECRET }} | |
| steps: | |
| - name: git checkout | |
| uses: actions/checkout@v4 | |
| - name: setup go-crx3 | |
| run: | | |
| wget https://github.com/mmadfox/go-crx3/releases/download/v1.6.0/go-crx3_1.6.0_linux_amd64.tar.gz | |
| tar xvf go-crx3_1.6.0_linux_amd64.tar.gz | |
| chmod +x go-crx3 && mv go-crx3 $HOME/.local/bin/ | |
| - name: build addon | |
| run: make build-firefox | |
| - name: setup node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| - name: install web-ext | |
| run: npm i -g web-ext | |
| - name: sign with AMO (if secrets provided) | |
| if: ${{ env.AMO_JWT_ISSUER != '' && env.AMO_JWT_SECRET != '' }} | |
| env: | |
| WEB_EXT_API_KEY: ${{ secrets.AMO_JWT_ISSUER }} | |
| WEB_EXT_API_SECRET: ${{ secrets.AMO_JWT_SECRET }} | |
| run: | | |
| web-ext sign \ | |
| --api-key "$AMO_JWT_ISSUER" \ | |
| --api-secret "$AMO_JWT_SECRET" \ | |
| --channel listed | |
| --id sanitize-amazon@devloberto \ | |
| --source-dir . \ | |
| --artifacts-dir ./web-ext-artifacts | |
| - name: upload signed crx artifact | |
| if: ${{ env.AMO_JWT_ISSUER != '' && env.AMO_JWT_SECRET != '' }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ env.ARTIFACT_NAME }}_firefox | |
| path: web-ext-artifacts/*.crx |