Skip to content

Commit

Permalink
Merge pull request #101 from jeremymeng/add-push-tag-to-draft-release…
Browse files Browse the repository at this point in the history
…-workflow

Add a workflow to draft release on pushed `v*` tag
  • Loading branch information
jeremymeng authored May 5, 2023
2 parents 2ed85fd + 9db8612 commit ee528d1
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/draft-release-on-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Draft Release

on:
push:
tags:
- v*

jobs:
release:
permissions: write-all
name: Draft Release on Tag
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
- run: npm pack
- name: Draft release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REF: ${{ github.event.ref }}
run: |
tag=${REF##*/}
gh release create "${tag}" \
--repo="$GITHUB_REPOSITORY" \
--title="${GITHUB_REPOSITORY#*/} ${tag#v}" \
--generate-notes \
--draft \
./*.tgz

0 comments on commit ee528d1

Please sign in to comment.