Skip to content

Commit 4621c54

Browse files
authored
chore: auto-draft release (#225)
1 parent 1506614 commit 4621c54

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.github/workflows/release.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,20 @@ on:
66
pull_request:
77

88
jobs:
9+
manifest:
10+
runs-on: ubuntu-latest
11+
outputs:
12+
version: ${{ steps.extract.outputs.version }}
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
- id: extract
17+
working-directory: ./workspace/extension/static
18+
run: echo "version=$(jq -r '.version' manifest.json)" >> $GITHUB_OUTPUT
19+
920
bundle:
1021
runs-on: ubuntu-latest
22+
needs: manifest
1123

1224
steps:
1325
- uses: actions/checkout@v4
@@ -26,6 +38,22 @@ jobs:
2638
name: extension-${{ github.sha }}
2739
path: workspace/extension/build/svelte-devtools.zip
2840

41+
- if: |
42+
github.repository == 'sveltejs/svelte-devtools' &&
43+
github.event_name == 'push' && github.ref == 'refs/heads/master' &&
44+
startsWith(github.event.head_commit.message, format('~ v{0}', needs.manifest.outputs.version))
45+
env:
46+
GH_TOKEN: ${{ github.token }}
47+
run: | # https://cli.github.com/manual/gh_release_create
48+
gh release create v${{ needs.manifest.outputs.version }} \
49+
workspace/extension/build/svelte-devtools.zip \
50+
--title ${{ needs.manifest.outputs.version }} \
51+
--draft --generate-notes --notes '
52+
Built from ${{ github.event.head_commit.id }} at https://github.com/sveltejs/svelte-devtools/actions/runs/${{ github.run_id }}
53+
- Chrome Web Store: https://chrome.google.com/webstore/detail/svelte-devtools/kfidecgcdjjfpeckbblhmfkhmlgecoff
54+
- Firefox Signed Add-on: https://github.com/sveltejs/svelte-devtools/releases/download/v${{ needs.manifest.outputs.version }}/svelte-devtools.xpi
55+
---'
56+
2957
# publish:
3058
# runs-on: ubuntu-latest
3159
# needs: bundle

0 commit comments

Comments
 (0)