Skip to content

Commit

Permalink
add create-release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
hagenest authored Feb 19, 2025
1 parent ed6374c commit 61bc19f
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
name: Create Release
on: # yamllint disable-line rule:truthy
workflow_call:
workflow_dispatch:
inputs:
run-id:
description: "The Run-ID for the workflow."
type: number
required: true
permissions:
contents: write
env:
SET_X: 1
jobs:
create-release:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
pattern: changelogs-*
merge-multiple: true
run-id: ${{ inputs.run-id || github.run_id }}
github-token: ${{ github.token }}
- name: Install Just
uses: ./.github/actions/install-just
- name: Prepare Release
id: prepare-release
shell: bash
run: |
set -eoux pipefail
output="$(just merge-changelog)"
cat changelog.md
jq -r <<< "$output"
for k in $(jq 'keys[]' <<< "$output" | tr -d \"); do
echo "$k=$(jq -r ".$k" <<< "$output")" >> $GITHUB_OUTPUT
done
- name: Upload Changelogs as Artifact
uses: actions/upload-artifact@v4
with:
name: release-changelog
path: ./changelog.md
if-no-files-found: error
retention-days: 0
compression-level: 0
overwrite: true
- name: Create Release
uses: softprops/action-gh-release@v2
if: >-
contains(fromJson('["workflow_dispatch", "merge_group"]'),
github.event_name)
|| github.event.schedule == '41 6 * * 0'
with:
name: ${{ steps.prepare-release.outputs.title }}
tag_name: ${{ steps.prepare-release.outputs.tag }}
body_path: ./changelog.md
make_latest: true

0 comments on commit 61bc19f

Please sign in to comment.