From d6eab18ba0054ae8996571ad56ee128812f730f3 Mon Sep 17 00:00:00 2001 From: Philipp Kewisch Date: Thu, 19 Dec 2024 23:40:56 +0100 Subject: [PATCH] chore: Github release actions --- .github/workflows/ci.yaml | 4 +-- .github/workflows/publish.yaml | 49 ++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/publish.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5650486..2f67b21 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -12,12 +12,12 @@ jobs: runs-on: ubuntu-latest steps: - name: "Checkout" - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: "Setup node" - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: "latest" diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..ab7b8f7 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,49 @@ +--- + +name: "Publish" +on: + release: + types: [published] +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: "Checkout" + uses: actions/checkout@v4 + + - name: "Setup Node" + uses: actions/setup-node@v4 + with: + node-version: latest + + - name: "npm ci" + run: npm ci + + - name: "build" + run: npm run build + + - name: "web-ext build" + id: web-ext-build + uses: kewisch/action-web-ext@v1 + with: + cmd: build + source: src + + - name: "web-ext sign" + uses: kewisch/action-web-ext@v1 + with: + cmd: sign + source: ${{ steps.web-ext-build.outputs.target }} + channel: listed + apiUrlPrefix: "https://addons.thunderbird.net/api/v4" + apiKey: ${{ secrets.AMO_SIGN_KEY }} + apiSecret: ${{ secrets.AMO_SIGN_SECRET }} + + - name: "Attach release assets" + env: + GH_TOKEN: ${{ github.token }} + run: | + gh release upload ${{ github.event.release.tag_name }} \ + web-ext-artifacts/*.zip