-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yaml
More file actions
76 lines (67 loc) · 2.72 KB
/
action.yaml
File metadata and controls
76 lines (67 loc) · 2.72 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
name: Yaclog
description: Get version information from a changelog
branding:
icon: file-text
color: orange
x-example-name: Get version info
inputs:
changelog-path:
description: "Path of the changelog markdown file"
markdown:
description: "If the output should be in markdown format or not. Equivalent to the `--markdown` flag"
default: 'true'
release:
description: |
When set, creates a new release and commits it. Directly passed to the arguments of `yaclog release --yes --commit`.
Can be a version number or an increment tag like `--major`, `--minor`, or `--patch`. The resulting commit and tag will NOT be pushed back to the repo. You must add a step to do this yourself
outputs:
name:
description: "The most recent version name, equivalent to the output of `yaclog show --name`. For example, `Version 1.3.0`"
value: ${{ steps.yaclog-show.outputs.name}}
header:
description: "The entire header for the most recent version, equivalent to the output of `yaclog show --header`. For example, `Version 1.3.0 - 2024-08-08`"
value: ${{ steps.yaclog-show.outputs.header }}
version:
description: "The current version number, equivalent to the output of `yaclog show --version`. For example, `1.3.1`"
value: ${{ steps.yaclog-show.outputs.version }}
body-file:
description: "The path to a temporary file containing the body of the most recent version. Contents equivalent to `yaclog show --body`"
value: ${{ steps.yaclog-show.outputs.body-file }}
body_file:
description: "Alias for body-file"
value: ${{ steps.yaclog-show.outputs.body-file }}
changelog:
description: "The path to the changelog file. Usually `CHANGELOG.md` in the current directory."
value: ${{ steps.yaclog-show.outputs.changelog }}
runs:
using: "composite"
steps:
- name: Setup uv
shell: bash
run: |
if ! command -v uv >/dev/null 2>&1; then
curl -LsSf https://astral.sh/uv/install.sh | sh
else
echo "uv already installed"
fi
env:
UV_UNMANAGED_INSTALL: /usr/local/bin
- name: Create New Release
shell: bash
if: ${{ inputs.release }}
run: >
uv run -m yaclog release --yes --commit ${{ inputs.release }}
env:
UV_PROJECT: ${{ github.action_path }}
UV_LINK_MODE: copy
UV_FROZEN: true
- name: Get Changelog Information
id: yaclog-show
shell: bash
run: >
uv run -m yaclog ${{ inputs.changelog-path && format('--path {0}', inputs.changelog-path) || '' }}
show ---gh-actions ${{ inputs.markdown && '--markdown' || ''}} | tee -a "$GITHUB_OUTPUT"
env:
UV_PROJECT: ${{ github.action_path }}
UV_LINK_MODE: copy
UV_FROZEN: true