Allow keeping the workflow dispatch release as drafts

This is useful for testing the release before publishing (something we
might need for newly released 13.0.0).

Also, clean up `${{}}` in `if`s, apparently they are not needed (even
though they are used throughout the documentation):

https://docs.github.com/en/actions/learn-github-actions/expressions#about-expressions
This commit is contained in:
Kirill Bobyrev 2021-10-01 08:32:13 +02:00
parent c0845399c6
commit 24f54680f8
No known key found for this signature in database
GPG Key ID: 2307C055C8384FA0

View File

@ -27,11 +27,14 @@ on:
description: description:
description: 'Release description' description: 'Release description'
required: true required: true
keep_as_draft:
description: 'Put "true" to avoid publishing the release'
required: false
jobs: jobs:
schedule_environment: schedule_environment:
name: Create default build environment name: Create default build environment
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: ${{ github.event_name == 'schedule' }} if: github.event_name == 'schedule'
steps: steps:
- name: Install deps - name: Install deps
run: | run: |
@ -75,7 +78,7 @@ jobs:
workflow_dispatch_environment: workflow_dispatch_environment:
name: Use inputs to create build environment name: Use inputs to create build environment
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: ${{ github.event_name == 'workflow_dispatch' }} if: github.event_name == 'workflow_dispatch'
steps: steps:
- name: Use repo and commit from the inputs - name: Use repo and commit from the inputs
run: | run: |
@ -318,7 +321,7 @@ jobs:
finalize: finalize:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build needs: build
if: always() && needs.build.result == 'success' if: always() && needs.build.result == 'success' && !(github.event_name == 'workflow_dispatch' && github.event.inputs.keep_as_draft == 'true')
steps: steps:
- name: Fetch release info - name: Fetch release info
uses: actions/download-artifact@v1 uses: actions/download-artifact@v1