generated from ublue-os/image-template
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (64 loc) · 1.85 KB
/
create-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
---
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-24.04
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 == '42 6 * * 0'
with:
name: ${{ steps.prepare-release.outputs.title }}
tag_name: ${{ steps.prepare-release.outputs.tag }}
body_path: ./changelog.md
make_latest: true