-
Notifications
You must be signed in to change notification settings - Fork 129
66 lines (56 loc) · 2.16 KB
/
prepare_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
name: 🥘 Prepare Release
on:
workflow_dispatch:
inputs:
sdk-version:
description: 'SDK Version'
required: true
jobs:
# WORKFLOW
# - Ask for the base branch (Otherwise this would only work for the latest develop - e.g. not v4 or v5 once develop represents v6)
# - Check if Version number is already "sdk-version" - if not -> run bump build number script
# - Get release notes -> (Use them as PR description)
# - Generate Docs
# - Branch off to release/[sdk-version]
# version-number-update:
# name: "Update version number if needed"
get-release-notes:
name: "Get Release Notes"
uses: ./.github/workflows/get_release_notes.yml
post-release-notes:
name: "Create Release Pull Request"
needs: get-release-notes
runs-on: macos-14
steps:
# Checking out the current branch
- uses: actions/checkout@v4
with:
fetch-depth: 0
# Cancel previous runs
- uses: n1hility/cancel-previous-runs@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
# Generating Docs (will show up as changes in the PR)
- name: Generate Docs
run: |
Scripts/generate_docc_documentation.sh
env:
LATEST_VERSION: ${{ github.event.inputs.sdk-version }}
# Sanitizing the Release Notes from the get-release-notes job
- name: Prepare Release Notes
run: |
SANITIZED_RELEASE_NOTES=$(echo "$RELEASE_NOTES" | sed 'H;1h;$!d;x;s/NEW_LINE_TOKEN/\n/g' )
echo "# Changes since last release
$SANITIZED_RELEASE_NOTES" >> "${{ github.workspace }}/release_notes.md"
env:
RELEASE_NOTES: ${{ needs.get-release-notes.outputs.RELEASE_NOTES }}
# Creates a release/[sdk-version] branch with a PR to develop
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
delete-branch: true
branch: "release/${{ github.event.inputs.sdk-version }}"
commit-message: "chore: updating documentation"
title: "[Release] ${{ github.event.inputs.sdk-version }}"
body: ${{ needs.get-release-notes.outputs.RELEASE_NOTES }}
token: ${{ secrets.GITHUB_TOKEN }}