Release #10
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: Release | |
on: | |
workflow_dispatch: | |
# Inputs the workflow accepts. | |
inputs: | |
tag: | |
description: "Tag name, e.g. 0.4.0" | |
default: 0.6.0 | |
required: true | |
release: | |
description: "Release name, e.g. release-0.4.0" | |
default: release-0.6.0 | |
required: true | |
jobs: | |
build: | |
name: Upload Release Asset | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get current date | |
id: date | |
run: echo "::set-output name=date::$(date +'%Y-%m-%d')" | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Create tag | |
uses: actions/github-script@v5 | |
with: | |
script: | | |
github.rest.git.createTag({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
object: context.sha, | |
tag: '${{ github.event.inputs.tag }}', | |
message: '${{ github.event.inputs.tag }}', | |
type: 'commit', | |
tagger: { | |
name: context.actor, | |
email: context.actor + '@users.noreply.github.com', | |
}, | |
}) | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.event.inputs.tag }} | |
release_name: ${{ github.event.inputs.release }} | |
draft: false | |
prerelease: false | |
create-release-branch: | |
name: Create release branch | |
permissions: | |
contents: write | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Create release branch | |
uses: peterjgrainger/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
branch: ${{ github.event.inputs.release }} | |
sha: '${{ github.event.pull_request.head.sha }}' |