Skip to content

Generate Release

Generate Release #2

on:
workflow_call:
inputs:
make_latest:
description: "Make latest for Release"
type: string
default: 'False'
stream_name:
description: "Release Tag (e.g. gts, stable)"
type: string
required: true
workflow_dispatch:
inputs:
handwritten:
description: "Small Changelog about changes in this build"
make_latest:
description: "Make latest for Release"
type: choice
default: 'False'
options:
- 'False'
- 'True'
stream_name:
description: "Release Tag (e.g. gts, stable)"
required: true
type: choice
options:
- '["gts", "stable"]'
- '["gts"]'
- '["stable"]'
# - '["stable-daily"]'
# - '["latest"]'
# - '["beta"]'
# - '["stable-daily", "latest", "beta"]'
# - '["gts", "stable", "stable-daily", "latest", "beta"]'
permissions:
contents: write
name: Generate Release
jobs:
generate-release:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version: ${{ fromJson( inputs.stream_name ) }}
steps:
- name: Checkout last 500 commits (for <commits> to work)
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 500
- name: Install Just
shell: bash
run: |
set -eoux pipefail
JUST_VERSION=$(curl -L https://api.github.com/repos/casey/just/releases/latest | jq -r '.tag_name')
curl -sSLO https://github.com/casey/just/releases/download/${JUST_VERSION}/just-${JUST_VERSION}-x86_64-unknown-linux-musl.tar.gz
tar -zxvf just-${JUST_VERSION}-x86_64-unknown-linux-musl.tar.gz -C /tmp just
sudo mv /tmp/just /usr/local/bin/just
rm -f just-${JUST_VERSION}-x86_64-unknown-linux-musl.tar.gz
- name: Check Just Syntax
shell: bash
run: |
just check
- name: Generate Release Text
id: generate-release-text
shell: bash
run: |
just changelogs "${{ matrix.version }}" "${{ github.event.inputs.handwritten }}"
source ./output.env
echo "title=${TITLE}" >> $GITHUB_OUTPUT
echo "tag=${TAG}" >> $GITHUB_OUTPUT
- name: Create Release
uses: softprops/action-gh-release@v2
if: contains(fromJson('["gts", "stable"]'), matrix.version) && (github.event_name.schedule == '45 5 * * 0' || contains(fromJson('["workflow_dispatch", "workflow_call"]'), 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: ${{ inputs.make_latest == 'True' && matrix.version == 'stable' || false }}
prerelease: ${{ inputs.make_latest != 'True' }}