-
Notifications
You must be signed in to change notification settings - Fork 4
97 lines (94 loc) · 2.72 KB
/
draft-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
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
# ------------------------------------------------------------------------------
# <auto-generated>
#
# This code was generated.
#
# - To turn off auto-generation set:
#
# [DraftReleaseJob (AutoGenerate = false)]
#
# - To trigger manual generation invoke:
#
# nuke --generate-configuration GitHubActions_draft-release --host GitHubActions
#
# </auto-generated>
# ------------------------------------------------------------------------------
name: Draft Release and Create Milestone
on:
workflow_call:
secrets:
RSG_BOT_TOKEN:
required: true
push:
branches:
- 'master'
paths-ignore:
- '**/*.md'
schedule:
- cron: '0 0 * * 4'
permissions:
actions: read
checks: read
contents: read
deployments: read
id-token: none
issues: write
discussions: none
packages: none
pages: none
pull-requests: write
repository-projects: none
security-events: none
statuses: write
jobs:
draft_release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
clean: 'false'
fetch-depth: '0'
- name: Fetch all history for all tags and branches
run: |
git fetch --prune
- name: 📲 Install DotNet
uses: actions/setup-dotnet@v4
- name: ⚒️ dotnet tool restore
run: |
dotnet tool restore
- name: 🔨 Use GitVersion
id: gitversion
shell: pwsh
run: |
$data = dotnet gitversion | ConvertFrom-Json
foreach ($item in $data.PSObject.Properties) {
$key = $item.Name
$value = $item.Value
echo "$($key.Substring(0,1).ToLower() + $key.Substring(1))=$value" >> $env:GITHUB_OUTPUT
}
- name: Create Milestone
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
uses: WyriHaximus/github-action-create-milestone@v1
with:
title: 'v${{ steps.gitversion.outputs.majorMinorPatch }}'
- name: sync milestones
uses: RocketSurgeonsGuild/actions/sync-milestone@v0.3.15
with:
default-label: ':sparkles: mysterious'
github-token: '${{ secrets.GITHUB_TOKEN }}'
- name: Create Release
uses: ncipollo/release-action@v1
with:
allowUpdates: 'true'
generateReleaseNotes: 'true'
updateOnlyUnreleased: 'true'
draft: 'true'
omitBodyDuringUpdate: 'true'
omitNameDuringUpdate: 'true'
omitDraftDuringUpdate: 'true'
name: 'v${{ steps.gitversion.outputs.majorMinorPatch }}'
tag: 'v${{ steps.gitversion.outputs.majorMinorPatch }}'
token: '${{ secrets.RSG_BOT_TOKEN }}'
commit: '${{ github.base_ref }}'