Create Release #30
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create Release | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Version' | |
required: true | |
default: 'MAJOR.MINOR.PATCH' | |
release_notes: | |
description: 'Release Notes' | |
required: true | |
jobs: | |
create_draft_release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Check version has the right format | |
run: | | |
[[ "${{ github.event.inputs.version }}" =~ ^[0-9]+[.][0-9]+[.][0-9]+$ ]] | |
- name: Create archive | |
run: | | |
mv dist kctf | |
echo ${{ github.event.inputs.version }} > kctf/VERSION | |
tar -cz kctf > kctf.tgz | |
git config user.name ${{ github.actor }} | |
git config user.email [email protected] | |
git tag v${{ github.event.inputs.version }} | |
git push origin v${{ github.event.inputs.version }} | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{ github.event.inputs.version }} | |
release_name: Release ${{ github.event.inputs.version }} | |
body: ${{ github.event.inputs.release_notes }} | |
draft: true | |
prerelease: false | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: kctf.tgz | |
asset_name: kctf.tgz | |
asset_content_type: application/gzip |