Skip to content

Generate Release

Generate Release #34

on:
schedule:
- cron: '05 11 * * *' # 11:05am UTC everyday
workflow_call:
inputs:
stream_name:
description: "Release Tag (e.g. stream10, latest)"
type: string
default: "latest"
required: false
workflow_dispatch:
inputs:
handwritten:
description: "Small Changelog about changes in this build"
stream_name:
description: "Release Tag (e.g. gts, stable)"
required: false
default: '["latest"]'
type: choice
options:
- '["stream10"]'
- '["latest"]'
- '["stream10","latest"]'
permissions:
contents: write
name: Generate Release
jobs:
defaults:
runs-on: ubuntu-latest
outputs:
streams: ${{ steps.streams.outputs.stream_names }}
steps:
- name: Get stream with fallback
id: streams
run: |
if [ "${{ inputs.stream_name }}" == "" ] ; then
echo "stream_names=[\"latest\"]" >> $GITHUB_OUTPUT
exit 0
fi
echo "stream_names=${{ inputs.stream_name }}" >> $GITHUB_OUTPUT
generate-release:
runs-on: ubuntu-latest
needs: defaults
strategy:
fail-fast: false
matrix:
version: ${{ fromJson( needs.defaults.outputs.streams ) }}
steps:
- name: Checkout last 500 commits (for <commits> to work)
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 500
- name: Generate Release Text
id: generate-release-text
shell: bash
run: |
python3 .github/changelogs.py --workdir . "${{ matrix.version }}" ./output.env ./changelog.md --handwritten "${{ inputs.handwritten }}"
source ./output.env
echo "title=${TITLE}" >> $GITHUB_OUTPUT
echo "tag=${TAG}" >> $GITHUB_OUTPUT
- name: Create Release
uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda # v2
if: (github.event.schedule == '50 5 * * 0' || contains(fromJson('["workflow_dispatch", "workflow_call","schedule"]'), github.event_name))
with:
name: ${{ steps.generate-release-text.outputs.title }}
tag_name: ${{ steps.generate-release-text.outputs.tag }}
body_path: ./changelog.md
make_latest: true