-
-
Notifications
You must be signed in to change notification settings - Fork 117
140 lines (124 loc) · 4.78 KB
/
release-drafter.yml
File metadata and controls
140 lines (124 loc) · 4.78 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: ' 🛝 Release Drafter'
on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- main
# Run on demand
workflow_dispatch:
permissions:
contents: read
env:
# The branch to create the PR against
REF_BRANCH: main
# The branch to create the PR from
NEW_BRANCH: 'release-draft'
# Node.js version to use in the workflow
NODE_VERSION: 'lts/*'
jobs:
update_release_draft:
permissions:
contents: write # needed by release-drafter/release-drafter to write to the draft release.
runs-on: ubuntu-latest
outputs:
'tag_name': ${{ steps.release-drafter.outputs.tag_name }}
'name': ${{ steps.release-drafter.outputs.name }}
'resolved_version': ${{ steps.release-drafter.outputs.resolved_version }}
'major_version': ${{ steps.release-drafter.outputs.major_version }}
'minor_version': ${{ steps.release-drafter.outputs.minor_version }}
'body': ${{ steps.release-drafter.outputs.body }}
steps:
# Drafts your next Release notes as Pull Requests are merged into "main"
- id: release-drafter
uses: release-drafter/release-drafter@6db134d15f3909ccc9eefd369f02bd1e9cffdf97 # v5
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
# with:
# config-name: my-config.yml
# disable-autolabeler: true
with:
# See [Release Drafter is *sometimes* including unmerged PRs · Issue #917 · release-drafter/release-drafter](https://github.com/release-drafter/release-drafter/issues/917)
disable-releaser: false
disable-autolabeler: true
commitish: ${{ env.REF_BRANCH }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release Drafter Result
uses: streetsidesoftware/actions/public/summary@v1
with:
text: |
# Release Drafter Results
```
${{ toJSON(steps.release-drafter.outputs) }}
create-pr:
if: >-
${{ !startsWith(github.event.head_commit.message, 'chore: Prepare Release') }}
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
needs:
- update_release_draft
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup
uses: ./.github/actions/setup
with:
node-version: ${{ env.NODE_VERSION}}
- name: Update Change Log Files
env:
'GITHUB_RELEASE_TAG': ${{ needs.update_release_draft.outputs.tag_name }}
'GITHUB_RELEASE_BODY': ${{ needs.update_release_draft.outputs.body }}
'GITHUB_RELEASE_NAME': ${{ needs.update_release_draft.outputs.name }}
'GITHUB_RELEASE_VERSION': ${{ needs.update_release_draft.outputs.resolved_version }}
run: |
node ./scripts/gen-release.mts -s packages/*/CHANGELOG.md
node ./scripts/gen-release.mts CHANGELOG.md packages/cspell/CHANGELOG.md
- name: PR Body
id: body
uses: streetsidesoftware/actions/public/pr-body@v1
with:
title: Release ${{ needs.update_release_draft.outputs.name }}
message: |
## Release Notes
<details>
<summary>Details</summary>
${{ needs.update_release_draft.outputs.body }}
</details>
## Version Information
- **Tag**: `${{ needs.update_release_draft.outputs.tag_name }}`
- **Version**: `${{ needs.update_release_draft.outputs.resolved_version }}`
- name: Create PR
uses: peter-evans/create-pull-request@v8
with:
commit-message: 'chore: Prepare Release ${{ needs.update_release_draft.outputs.name }}'
branch: ${{ env.NEW_BRANCH }}
base: ${{ env.REF_BRANCH }}
title: 'chore: Prepare Release ${{ needs.update_release_draft.outputs.name }} (auto-deploy)'
body: |
${{ steps.body.outputs.body }}
token: ${{ secrets.GITHUB_TOKEN }}
sign-commits: true # Sign commits made by the action
# event-info:
# runs-on: ubuntu-latest
# steps:
# - name: Show Event Info
# uses: streetsidesoftware/actions/public/summary@v1
# with:
# text: |
# # Event Information
# ```
# ${{ toJSON(github.event) }}
# ```
create-release:
if: >-
${{ startsWith(github.event.head_commit.message, 'chore: Prepare Release') && contains(github.event.head_commit.message, '(auto-deploy)') }}
permissions:
contents: write
id-token: write
uses: ./.github/workflows/build-version-release.yml
with:
dry_run: false
secrets:
PUBLISH_NPM: ${{ secrets.PUBLISH_NPM }}
# cspell:ignore auto* *labeler commitish