From 9def9d5741c2f1ad80d11b8ed3209656c780bf93 Mon Sep 17 00:00:00 2001 From: Kuuuube <61125188+Kuuuube@users.noreply.github.com> Date: Wed, 25 Dec 2024 14:04:19 -0500 Subject: [PATCH] Add upload_url to publish-chrome-development action (#1697) * Add upload_url to publish-chrome-development action * Split release crx to separate job * Add release download to release-crx * Add asset_content_type --- .github/workflows/create-prerelease-on-tag.yml | 1 + .../workflows/publish-chrome-development.yml | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/.github/workflows/create-prerelease-on-tag.yml b/.github/workflows/create-prerelease-on-tag.yml index 369750f03..0545f1806 100644 --- a/.github/workflows/create-prerelease-on-tag.yml +++ b/.github/workflows/create-prerelease-on-tag.yml @@ -52,6 +52,7 @@ jobs: workflow: publish-chrome-development token: ${{ secrets.GITHUB_TOKEN }} wait-for-completion: false + inputs: '{ "upload_url": "${{ steps.release.outputs.upload_url }}" }' - name: Dispatch publish-firefox-development uses: aurelien-baudet/workflow-dispatch@3133c5d135c7dbe4be4f9793872b6ef331b53bc7 # pin@v2 diff --git a/.github/workflows/publish-chrome-development.yml b/.github/workflows/publish-chrome-development.yml index 73d498140..a3578ec07 100644 --- a/.github/workflows/publish-chrome-development.yml +++ b/.github/workflows/publish-chrome-development.yml @@ -10,6 +10,9 @@ on: description: "Max attempts" required: false default: "10" + upload_url: + description: "The upload_url from the release created by create-prerelease-on-tag.yml" + required: true permissions: contents: read jobs: @@ -97,6 +100,19 @@ jobs: extensionId: ${{ secrets.G_DEVELOPMENT_EXTENSION_ID }} apiAccessToken: ${{ steps.fetchAccessToken.outputs.accessToken }} + release-crx: + runs-on: ubuntu-latest + environment: cd + permissions: + actions: write + contents: write + + steps: + - uses: robinraju/release-downloader@a96f54c1b5f5e09e47d9504526e96febd949d4c2 # pin@v1.11 + with: + tag: ${{ github.ref_name }} + fileName: "*" + - name: Sign Chrome crx for offline distribution uses: cardinalby/webext-buildtools-chrome-crx-action@v2 with: @@ -113,3 +129,4 @@ jobs: upload_url: ${{ inputs.upload_url }} asset_path: yomitan-chrome-dev.crx asset_name: yomitan-chrome-dev.crx + asset_content_type: application/x-chrome-extension