Skip to content

Release

Release #1

Workflow file for this run

name: Release
on:
workflow_dispatch:
# Inputs the workflow accepts.
inputs:
tag:
description: "Tag name, e.g. 0.4.0"
default: 0.4.0
required: true
release:
description: "Release name, e.g. release-0.4.0"
default: release-0.4.0
required: true
jobs:
build:
name: Upload Release Asset
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.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/${{ github.event.inputs.tag }}',
sha: context.sha
})
- 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
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Create release branch
uses: peterjgrainger/action-create-branch@v2.2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
branch: ${{ github.event.inputs.release }}
sha: '${{ github.event.pull_request.head.sha }}'