diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 44681c1..0f96dc4 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -6,8 +6,20 @@ on: pull_request: jobs: + manifest: + runs-on: ubuntu-latest + outputs: + version: ${{ steps.extract.outputs.version }} + + steps: + - uses: actions/checkout@v4 + - id: extract + working-directory: ./workspace/extension/static + run: echo "version=$(jq -r '.version' manifest.json)" >> $GITHUB_OUTPUT + bundle: runs-on: ubuntu-latest + needs: manifest steps: - uses: actions/checkout@v4 @@ -26,6 +38,22 @@ jobs: name: extension-${{ github.sha }} path: workspace/extension/build/svelte-devtools.zip + - 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)) + env: + GH_TOKEN: ${{ github.token }} + run: | # https://cli.github.com/manual/gh_release_create + gh release create v${{ needs.manifest.outputs.version }} \ + workspace/extension/build/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 }} + - 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 + ---' + # publish: # runs-on: ubuntu-latest # needs: bundle