Skip to content

Create Pre-Release #278

Create Pre-Release

Create Pre-Release #278

Workflow file for this run

name: Create Pre-Release
on:
workflow_dispatch:
inputs:
commit:
description: 'Release commit'
required: true
permissions:
contents: write
jobs:
pre-release:
name: Pre-release
runs-on: ubuntu-20.04
steps:
- name: Harden Runner
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
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@cdcc88a9acf3ca41c16c37bb7d21b9ad48560d87 # v1.15.0
with:
bodyFile: release_body.md
commit: ${{ github.event.inputs.commit }}
prerelease: true
tag: ${{ env.TAG_VERSION }}
token: ${{ secrets.GITHUB_TOKEN }}