Skip to content

Commit

Permalink
Add pre-release option to GitHub action
Browse files Browse the repository at this point in the history
Signed-off-by: Stephano Cetola <[email protected]>
  • Loading branch information
Stephano Cetola committed May 10, 2022
1 parent da15f4c commit 251ff26
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/build-pdf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ on:
branches:
- main
workflow_dispatch:
inputs:
prerelease:
description: 'Generate a pre-release.'
required: false
type: boolean

jobs:
build:
Expand Down Expand Up @@ -57,3 +62,25 @@ jobs:
name: result.pdf
path: ${{ env.PDF_RESULT }}
retention-days: 7
- name: Create Release
id: create_release
if: ${{ github.event.inputs.prerelease }}
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref_name }}
draft: false
prerelease: true
- name: Upload Release Asset
id: upload-release-asset
if: ${{ github.event.inputs.prerelease }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./example.pdf
asset_name: example.pdf
asset_content_type: application/pdf

0 comments on commit 251ff26

Please sign in to comment.