Signed-off-by: m2 <69128853+m2Giles@users.noreply.github.com> Co-authored-by: Benjamin Sherman <benjamin@holyarmy.org> Co-authored-by: Jorge O. Castro <jorge.castro@gmail.com> Co-authored-by: befanyt <172807209+befanyt@users.noreply.github.com>
85 lines
2.8 KiB
YAML
85 lines
2.8 KiB
YAML
on:
|
|
workflow_call:
|
|
inputs:
|
|
make_latest:
|
|
description: "Make latest for Release"
|
|
type: boolean
|
|
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"]'
|
|
- '["latest"]'
|
|
- '["beta"]'
|
|
- '["gts", "stable"]'
|
|
- '["gts", "stable", "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('["workflow_dispatch", "workflow_call"]'), github.event_name) || contains(fromJson('["45 5 * * 0", "40 4 * * 0"]'), github.event_name.schedule)
|
|
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 != false }}
|