Skip to content

feat: Allow source code submission and metadata changes #140

feat: Allow source code submission and metadata changes

feat: Allow source code submission and metadata changes #140

Workflow file for this run

---
name: "Build"
on:
push:
branches:
- main
pull_request:
jobs:
build:
name: "Build"
runs-on: ubuntu-latest
outputs:
name: ${{ steps.web-ext-build.outputs.name }}
steps:
- name: "Checkout"
uses: actions/checkout@v4
- name: "Run Linters"
run: npm run lint
- name: "Bump version"
run: |
export VERSION="1.$((10#${GITHUB_RUN_ID:0:4})).$((10#${GITHUB_RUN_ID:4})).${GITHUB_RUN_ATTEMPT}"
jq ".version = \"$VERSION\"" test/extension/manifest.json > manifest.json~
mv manifest.json~ test/extension/manifest.json
git diff test/extension
- name: "Self-test: lint"
id: web-ext-lint
uses: "./"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
cmd: lint
source: test/extension
channel: unlisted
- name: "Self-test: build"
id: web-ext-build
uses: "./"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
cmd: build
source: test/extension
channel: unlisted
- name: "Upload Unsigned"
uses: actions/upload-artifact@v4
with:
name: unsigned.xpi
path: ${{ steps.web-ext-build.outputs.target }}
if-no-files-found: error
amo:
name: "Self-test: AMO release"
runs-on: ubuntu-latest
needs: build
env:
HAS_SIGN_KEY: ${{ secrets.AMO_SIGN_KEY != '' && secrets.AMO_SIGN_SECRET != '' }}
steps:
- name: "Checkout"
if: env.HAS_SIGN_KEY
uses: actions/checkout@v4
- name: "Get release build"
if: env.HAS_SIGN_KEY
uses: actions/download-artifact@v4
with:
name: unsigned.xpi
path: web-ext-artifacts
- name: "Collect sources"
if: env.HAS_SIGN_KEY
run: git archive --format=zip --output=sources.zip HEAD
- name: "Collect metadata"
if: env.HAS_SIGN_KEY
id: metadata
run: echo "json=$(jq -c . < test/amo_metadata.json)" >> $GITHUB_OUTPUT
- name: "Release"
if: env.HAS_SIGN_KEY
id: web-ext-sign-amo
uses: "./"
with:
cmd: sign
source: web-ext-artifacts/${{ needs.build.outputs.name }}
sourceCode: sources.zip
channel: unlisted
metaDataJson: ${{ steps.metadata.outputs.json }}
approvalNotes: "Please find more information at https://github.com/kewisch/action-web-ext"
releaseNotes: "Triggered by ${{ github.event_name }} for ${{ github.sha }}"
license: MPL-2.0
apiKey: ${{ secrets.AMO_SIGN_KEY }}
apiSecret: ${{ secrets.AMO_SIGN_SECRET }}
- name: "Upload AMO signed"
if: env.HAS_SIGN_KEY
uses: actions/upload-artifact@v4
with:
name: amo-signed.xpi
path: ${{ steps.web-ext-sign-amo.outputs.target }}
if-no-files-found: error
atn:
name: "Self-test: ATN release"
runs-on: ubuntu-latest
needs: build
env:
HAS_SIGN_KEY: ${{ secrets.ATN_SIGN_KEY != '' && secrets.ATN_SIGN_SECRET != '' }}
steps:
- name: "Checkout"
if: env.HAS_SIGN_KEY
uses: actions/checkout@v4
- name: "Get release build"
if: env.HAS_SIGN_KEY
uses: actions/download-artifact@v4
with:
name: unsigned.xpi
path: web-ext-artifacts
- name: "Self-test: ATN release"
if: env.HAS_SIGN_KEY
id: web-ext-sign-atn
uses: "./"
with:
cmd: sign
source: web-ext-artifacts/${{ needs.build.outputs.name }}
channel: unlisted
apiUrlPrefix: "https://addons.thunderbird.net/api/v4"
apiKey: ${{ secrets.ATN_SIGN_KEY }}
apiSecret: ${{ secrets.ATN_SIGN_SECRET }}