-
Notifications
You must be signed in to change notification settings - Fork 146
98 lines (83 loc) · 3.19 KB
/
release-draft.yml
File metadata and controls
98 lines (83 loc) · 3.19 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
name: Release Drafter
on:
push:
branches:
- main
permissions:
contents: read
jobs:
dispatch_commit:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Prepare dispatch token
id: dispatch_token
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
with:
client-id: ${{ secrets.TEMPORAL_CICD_APP_ID }}
private-key: ${{ secrets.TEMPORAL_CICD_PRIVATE_KEY }}
permission-contents: write
repositories: ${{ vars.DOWNSTREAM_REPO }}
- name: Trigger ui-server workflow
uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4.0.1
with:
token: ${{ steps.dispatch_token.outputs.token }}
repository: ${{ vars.DOWNSTREAM_ORG }}/${{ vars.DOWNSTREAM_REPO }}
event-type: sync-from-ui-commit
client-payload: |
{
"ref": "${{ github.sha }}"
}
check_version_change:
runs-on: ubuntu-latest
outputs:
version-ready: ${{ steps.version-check.outputs.version-ready }}
current-version: ${{ steps.version-check.outputs.current-version }}
previous-version: ${{ steps.version-check.outputs.previous-version }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
fetch-tags: true
- name: Validate version for release readiness
id: version-check
uses: ./.github/actions/validate-release-readiness
update_release_draft:
needs: check_version_change
# Only run if version validation passed (sync + increase)
if: needs.check_version_change.outputs.version-ready == 'true'
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Create release draft
uses: release-drafter/release-drafter@563bf132657a13ded0b01fcb723c5a58cdd824e2 # v7.2.1
with:
version: ${{ needs.check_version_change.outputs.current-version }}
token: ${{ secrets.GITHUB_TOKEN }}
skip_notification:
needs: check_version_change
# Run if version validation failed
if: needs.check_version_change.outputs.version-ready == 'false'
runs-on: ubuntu-latest
steps:
- name: Skip reason - Version validation failed
run: |
echo "## ℹ️ Release Draft Skipped"
echo ""
echo "**Reason:** Version validation failed"
echo "**Current Version:** ${{ needs.check_version_change.outputs.current-version }}"
echo "**Previous Version:** ${{ needs.check_version_change.outputs.previous-version }}"
echo ""
echo "Draft releases are only created when:"
echo "1. Both package.json and version.go have matching versions"
echo "2. The version has increased compared to the previous commit"
echo ""
echo "To create a release, use the Version Bump workflow:"
echo "Actions → Version Bump → Run workflow"