From 9990eb0a66b39d6e510104365df349101e5a1afc Mon Sep 17 00:00:00 2001 From: folex <0xdxdy@gmail.com> Date: Fri, 28 May 2021 19:38:21 +0300 Subject: [PATCH] Add a button for creating releases manually (#136) --- .github/workflows/release.yml | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5deefe05..a361a59b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,10 +10,10 @@ on: workflow_dispatch: inputs: - draft: - description: "Whether to create draft or actual release. 'false' by default, put 'true' to make draft release" + release: + description: "Draft or public release?\nPut 'draft' to make a draft release" required: false - default: false + default: 'public' jobs: release: @@ -82,6 +82,15 @@ jobs: env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Determine if release should be drafted + run: | + set -x + if [ "${{ github.event.inputs.release }}" = "public" ]; then + echo "DRAFT=false" >> $GITHUB_ENV + else + echo "DRAFT=true" >> $GITHUB_ENV + fi + ### create release - uses: marvinpinto/action-automatic-releases@latest with: @@ -92,8 +101,6 @@ jobs: title: "Aqua Compiler ${{ env.VERSION }}" files: | ${{ env.JAR }} - body: | - [${{ env.VERSION }} @ NPM registry](https://www.npmjs.com/package/${{ env.PKG_NAME }}/v/${{ env.VERSION }}) - draft: true #${{ github.event.inputs.draft }} + draft: ${{ env.DRAFT }} prerelease: false - repo_token: "${{ secrets.GITHUB_TOKEN }}" + repo_token: "${{ secrets.GITHUB_TOKEN }}" \ No newline at end of file