From 9db86125d8ac39007362f899dd874136a265aceb Mon Sep 17 00:00:00 2001 From: Jeremy Meng Date: Thu, 4 May 2023 15:35:03 -0700 Subject: [PATCH] Add a workflow to draft release on pushed `v*` tag --- .github/workflows/draft-release-on-tag.yml | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/draft-release-on-tag.yml diff --git a/.github/workflows/draft-release-on-tag.yml b/.github/workflows/draft-release-on-tag.yml new file mode 100644 index 0000000..268b69b --- /dev/null +++ b/.github/workflows/draft-release-on-tag.yml @@ -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