Update release.yml #5
Workflow file for this run
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: | |
push: | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' # e.g., v1.2.3 | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Semantic Version (e.g., v1.2.3)' | |
required: true | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Determine Version | |
run: | | |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | |
echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV | |
else | |
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
fi | |
- name: Create GitHub Release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ env.VERSION }} | |
release_name: Release ${{ env.VERSION }} | |
draft: false | |
prerelease: false |