-
Notifications
You must be signed in to change notification settings - Fork 285
77 lines (63 loc) · 2.71 KB
/
draft_release.yml
File metadata and controls
77 lines (63 loc) · 2.71 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
---
name: "Draft new release"
on: # yamllint disable-line rule:truthy
workflow_dispatch:
inputs:
tag:
description: 'Tag to prepare (format: vXX.YY.ZZ)'
required: true
jobs:
new-release:
name: "Draft a new release"
runs-on: ubuntu-latest
steps:
- name: Install git-flow
run: sudo apt update && sudo apt install -y git-flow
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.11'
cache: 'pip'
cache-dependency-path: '**/setup.cfg'
- name: Configure git-flow
run: |
git fetch --tags --depth=1 origin master develop
git flow init --default --tag v
- name: Create release branch
run: git flow release start ${{ github.event.inputs.tag }}
- name: Initialize mandatory git config
run: |
git config user.name "GitHub actions"
git config user.email noreply@github.com
- name: Update CHANGELOG
run: |
python3 -m pip install mdformat-gfm 'git+https://github.com/Takishima/keepachangelog@v1.0.1'
python3 -m keepachangelog release "${{ github.event.inputs.tag }}"
python3 -m mdformat CHANGELOG.md
- name: Commit changelog and manifest files
id: make-commit
run: |
git add CHANGELOG.md
git commit --message "Preparing release ${{ github.event.inputs.tag }}"
echo "::set-output name=commit::$(git rev-parse HEAD)"
- name: Push new branch
run: git flow release publish ${{ github.event.inputs.tag }}
# yamllint disable rule:line-length
- name: Create pull request
uses: thomaseizinger/create-pull-request@1.3.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
head: release/${{ github.event.inputs.tag }}
base: master
title: Release version ${{ github.event.inputs.tag }}
reviewers: ${{ github.actor }}
# Write a nice message to the user.
# We are claiming things here based on the `publish-new-release.yml` workflow.
# You should obviously adopt it to say the truth depending on your release workflow :)
body: |
Hi @${{ github.actor }}!
This PR was created in response to a manual trigger of the release workflow here: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}.
I've updated the changelog and bumped the versions in the manifest files in this commit: ${{ steps.make-commit.outputs.commit }}.
Merging this PR will create a GitHub release and upload any assets that are created as part of the release build.