Skip to content

Create Pre-Release #209

Create Pre-Release

Create Pre-Release #209

Workflow file for this run

name: Create Pre-Release
on:
workflow_dispatch:
inputs:
commit:
description: 'Release commit'
required: true
jobs:
pre-release:
name: Pre-release
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3.1.0
with:
fetch-depth: 0
- name: Determine minor version
id: tag-setter
run: |
DATE=$(date +"%Y.%m.%d")
PREV_RELEASE=$(git tag --list | tail -1)
PREV_DATE="${PREV_RELEASE%.*}"
MINOR_VERSION=0
case $PREV_DATE in
*"$DATE"*)
MINOR_VERSION=${PREV_RELEASE##*.}
MINOR_VERSION=$((MINOR_VERSION+1))
;;
*)
MINOR_VERSION=0
;;
esac
echo "TAG_VERSION=r.$DATE.$MINOR_VERSION" >> $GITHUB_ENV
- name: Set the release commit
run: echo "RELEASE_COMMIT=${{ github.event.inputs.commit }}" >> $GITHUB_ENV
- name: Create release body file
run: bash .github/scripts/get_description.sh
- name: Set release body
uses: ncipollo/release-action@v1.11.1
with:
bodyFile: release_body.md
commit: ${{ github.event.inputs.commit }}
prerelease: true
tag: ${{ env.TAG_VERSION }}
token: ${{ secrets.GITHUB_TOKEN }}