From cfb820d29589cfcbfb749ec50379ec84647f7c35 Mon Sep 17 00:00:00 2001 From: Ignatius Bagus Date: Tue, 30 Jul 2024 15:23:57 +0700 Subject: [PATCH 1/5] chore: auto-sign extension --- .github/workflows/release.yaml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 44681c1..ccc8f1c 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -26,11 +26,34 @@ jobs: name: extension-${{ github.sha }} path: workspace/extension/build/svelte-devtools.zip + # TODO: upload zip to GitHub releases + + sign: + runs-on: ubuntu-latest + needs: bundle + # TODO: web-ext sign fails if version already exists, find another way to check + if: success() && startsWith(github.event.head_commit.message, '~ v') + + steps: + - uses: pnpm/action-setup@v4 + - uses: actions/download-artifact@v4 + with: + name: extension-${{ github.sha }} + + - run: pnpm dlx web-ext sign --channel unlisted --api-key ${{ secrets.WEB_EXT_API_KEY }} --api-secret ${{ secrets.WEB_EXT_API_SECRET }} + + - uses: actions/upload-artifact@v4 + with: + name: extension-${{ github.sha }} + + # TODO: upload signed extension to GitHub releases + + # TODO: publish to Chrome Web Store # publish: # runs-on: ubuntu-latest # needs: bundle # steps: - # - uses: actions/download-artifact@v3 + # - uses: actions/download-artifact@v4 # with: # name: extension-${{ github.sha }} From a15a126e55a5a27ab43cd456ba49fa208b025466 Mon Sep 17 00:00:00 2001 From: Ignatius Bagus Date: Wed, 4 Sep 2024 14:52:53 +0700 Subject: [PATCH 2/5] use checkout --- .github/workflows/release.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0dc7a92..93db8f9 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -50,6 +50,7 @@ jobs: # startsWith(github.event.head_commit.message, format('~ v{0}', needs.manifest.outputs.version)) steps: + - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 - uses: actions/download-artifact@v4 - run: ls -al From 1a9cdbd11747d575924ceefc6f6aca2616ad3d80 Mon Sep 17 00:00:00 2001 From: Ignatius Bagus Date: Wed, 4 Sep 2024 14:56:07 +0700 Subject: [PATCH 3/5] ls inside --- .github/workflows/release.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 93db8f9..f3928cc 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -53,7 +53,7 @@ jobs: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 - uses: actions/download-artifact@v4 - - run: ls -al + - run: ls -al extension-${{ github.sha }} # - run: | # pnpm dlx web-ext sign \ @@ -63,7 +63,7 @@ jobs: # - run: | # https://cli.github.com/manual/gh_release_create # gh release create v${{ needs.manifest.outputs.version }} \ - # workspace/extension/build/svelte-devtools.zip \ + # extension-${{ github.sha }}/svelte-devtools.zip \ # --title ${{ needs.manifest.outputs.version }} \ # --draft --generate-notes --notes ' # Built from ${{ github.event.head_commit.id }} at https://github.com/sveltejs/svelte-devtools/actions/runs/${{ github.run_id }} From d166d7137e96d688c62f44751fe85d56a0afb092 Mon Sep 17 00:00:00 2001 From: Ignatius Bagus Date: Wed, 4 Sep 2024 15:27:46 +0700 Subject: [PATCH 4/5] double check --- .github/workflows/release.yaml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f3928cc..994e585 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -41,8 +41,6 @@ jobs: sign: runs-on: ubuntu-latest needs: [manifest, bundle] - env: - GH_TOKEN: ${{ github.token }} # if: | # github.repository == 'sveltejs/svelte-devtools' && @@ -53,17 +51,21 @@ jobs: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 - uses: actions/download-artifact@v4 - - run: ls -al extension-${{ github.sha }} + - working-directory: extension-${{ github.sha }} + run: ls -al - # - run: | - # pnpm dlx web-ext sign \ - # --channel unlisted \ + # - working-directory: extension-${{ github.sha }} + # run: | + # pnpm dlx web-ext sign --channel unlisted \ # --api-key ${{ secrets.WEB_EXT_API_KEY }} \ - # --api-secret ${{ secrets.WEB_EXT_API_SECRET }} \ + # --api-secret ${{ secrets.WEB_EXT_API_SECRET }} - # - run: | # https://cli.github.com/manual/gh_release_create + # - working-directory: extension-${{ github.sha }} + # env: + # GH_TOKEN: ${{ github.token }} + # run: | # https://cli.github.com/manual/gh_release_create # gh release create v${{ needs.manifest.outputs.version }} \ - # extension-${{ github.sha }}/svelte-devtools.zip \ + # svelte-devtools.zip web-ext-artifacts/*.xpi#svelte-devtools.xpi \ # --title ${{ needs.manifest.outputs.version }} \ # --draft --generate-notes --notes ' # Built from ${{ github.event.head_commit.id }} at https://github.com/sveltejs/svelte-devtools/actions/runs/${{ github.run_id }} From 0103b49774c948eec1e0124bac67d0757bbdb88a Mon Sep 17 00:00:00 2001 From: Ignatius Bagus Date: Wed, 4 Sep 2024 15:44:03 +0700 Subject: [PATCH 5/5] finalize --- .github/workflows/release.yaml | 56 ++++++++++++++-------------------- 1 file changed, 23 insertions(+), 33 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 994e585..ac1a677 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -38,47 +38,37 @@ jobs: name: extension-${{ github.sha }} path: workspace/extension/build/svelte-devtools.zip - sign: + publish: runs-on: ubuntu-latest needs: [manifest, bundle] - # if: | - # github.repository == 'sveltejs/svelte-devtools' && - # github.event_name == 'push' && github.ref == 'refs/heads/master' && - # startsWith(github.event.head_commit.message, format('~ v{0}', needs.manifest.outputs.version)) + if: | + github.repository == 'sveltejs/svelte-devtools' && + github.event_name == 'push' && github.ref == 'refs/heads/master' && + startsWith(github.event.head_commit.message, format('~ v{0}', needs.manifest.outputs.version)) steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 - uses: actions/download-artifact@v4 - - working-directory: extension-${{ github.sha }} - run: ls -al - - # - working-directory: extension-${{ github.sha }} - # run: | - # pnpm dlx web-ext sign --channel unlisted \ - # --api-key ${{ secrets.WEB_EXT_API_KEY }} \ - # --api-secret ${{ secrets.WEB_EXT_API_SECRET }} - # - working-directory: extension-${{ github.sha }} - # env: - # GH_TOKEN: ${{ github.token }} - # run: | # https://cli.github.com/manual/gh_release_create - # gh release create v${{ needs.manifest.outputs.version }} \ - # svelte-devtools.zip web-ext-artifacts/*.xpi#svelte-devtools.xpi \ - # --title ${{ needs.manifest.outputs.version }} \ - # --draft --generate-notes --notes ' - # Built from ${{ github.event.head_commit.id }} at https://github.com/sveltejs/svelte-devtools/actions/runs/${{ github.run_id }} - # - Chrome Web Store: https://chrome.google.com/webstore/detail/svelte-devtools/kfidecgcdjjfpeckbblhmfkhmlgecoff - # - Firefox Signed Add-on: https://github.com/sveltejs/svelte-devtools/releases/download/v${{ needs.manifest.outputs.version }}/svelte-devtools.xpi - # ---' + - working-directory: extension-${{ github.sha }} + run: | + pnpm dlx web-ext sign --channel unlisted \ + --api-key ${{ secrets.WEB_EXT_API_KEY }} \ + --api-secret ${{ secrets.WEB_EXT_API_SECRET }} - # TODO: publish to Chrome Web Store - # publish: - # runs-on: ubuntu-latest - # needs: bundle + - working-directory: extension-${{ github.sha }} + env: + GH_TOKEN: ${{ github.token }} + run: | # https://cli.github.com/manual/gh_release_create + gh release create v${{ needs.manifest.outputs.version }} \ + svelte-devtools.zip web-ext-artifacts/*.xpi#svelte-devtools.xpi \ + --title ${{ needs.manifest.outputs.version }} \ + --draft --generate-notes --notes ' + Built from ${{ github.event.head_commit.id }} at https://github.com/sveltejs/svelte-devtools/actions/runs/${{ github.run_id }} + - Chrome Web Store: https://chrome.google.com/webstore/detail/svelte-devtools/kfidecgcdjjfpeckbblhmfkhmlgecoff + - Firefox Signed Add-on: https://github.com/sveltejs/svelte-devtools/releases/download/v${{ needs.manifest.outputs.version }}/svelte-devtools.xpi + ---' - # steps: - # - uses: actions/download-artifact@v4 - # with: - # name: extension-${{ github.sha }} + # TODO: publish to Chrome Web Store