forked from EveryInc/compound-engineering-plugin
-
Notifications
You must be signed in to change notification settings - Fork 1
101 lines (86 loc) · 3.25 KB
/
release-preview.yml
File metadata and controls
101 lines (86 loc) · 3.25 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: Release Preview
on:
workflow_dispatch:
inputs:
title:
description: "Conventional title to evaluate (defaults to the latest commit title on this ref)"
required: false
type: string
cli_bump:
description: "CLI bump override"
required: false
type: choice
options: [auto, patch, minor, major]
default: auto
compound_engineering_bump:
description: "compound-engineering bump override"
required: false
type: choice
options: [auto, patch, minor, major]
default: auto
coding_tutor_bump:
description: "coding-tutor bump override"
required: false
type: choice
options: [auto, patch, minor, major]
default: auto
marketplace_bump:
description: "marketplace bump override"
required: false
type: choice
options: [auto, patch, minor, major]
default: auto
cursor_marketplace_bump:
description: "cursor-marketplace bump override"
required: false
type: choice
options: [auto, patch, minor, major]
default: auto
jobs:
preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Determine title and changed files
id: inputs
shell: bash
run: |
TITLE="${{ github.event.inputs.title }}"
if [ -z "$TITLE" ]; then
TITLE="$(git log -1 --pretty=%s)"
fi
FILES="$(git diff --name-only HEAD~1...HEAD | tr '\n' ' ')"
echo "title=$TITLE" >> "$GITHUB_OUTPUT"
echo "files=$FILES" >> "$GITHUB_OUTPUT"
- name: Add preview note
run: |
echo "This preview currently evaluates the selected ref from its latest commit title and changed files." >> "$GITHUB_STEP_SUMMARY"
echo "It is side-effect free, but it does not yet reconstruct the full accumulated open release PR state." >> "$GITHUB_STEP_SUMMARY"
- name: Validate release metadata
run: bun run release:validate
- name: Preview release
shell: bash
run: |
TITLE='${{ steps.inputs.outputs.title }}'
FILES='${{ steps.inputs.outputs.files }}'
args=(--title "$TITLE" --json)
for file in $FILES; do
args+=(--file "$file")
done
args+=(--override "cli=${{ github.event.inputs.cli_bump || 'auto' }}")
args+=(--override "compound-engineering=${{ github.event.inputs.compound_engineering_bump || 'auto' }}")
args+=(--override "coding-tutor=${{ github.event.inputs.coding_tutor_bump || 'auto' }}")
args+=(--override "marketplace=${{ github.event.inputs.marketplace_bump || 'auto' }}")
args+=(--override "cursor-marketplace=${{ github.event.inputs.cursor_marketplace_bump || 'auto' }}")
bun run scripts/release/preview.ts "${args[@]}" | tee /tmp/release-preview.txt
- name: Publish preview summary
shell: bash
run: cat /tmp/release-preview.txt >> "$GITHUB_STEP_SUMMARY"