-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (52 loc) · 2.16 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
# Adapted from https://github.com/thomaseizinger/github-action-gitflow-release-workflow/blob/dev/.github/workflows/draft-new-release.yml
name: "Draft a new release"
on:
workflow_dispatch:
inputs:
version:
description: 'The version to release'
required: true
jobs:
draft-new-release:
name: "Draft a new release"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Create release branch
run: git checkout -b release/${{ github.event.inputs.version }}
- name: Update changelog
uses: thomaseizinger/keep-a-changelog-new-release@1.3.0
with:
version: ${{ github.event.inputs.version }}
- name: Initialize git config
run: |
git config user.name "GitHub actions"
git config user.email noreply@github.com
- name: Bump project version in gradle.properties
uses: jacobtomlinson/gha-find-replace@v2
with:
find: "version=.*"
replace: "version=${{ github.event.inputs.version }}"
include: "gradle.properties"
regex: true
- name: Commit changelog and manifest files
id: make-commit
run: |
git add CHANGELOG.md gradle.properties
git commit --message "Prepare release ${{ github.event.inputs.version }}"
echo "::set-output name=commit::$(git rev-parse HEAD)"
- name: Push new branch
run: git push origin release/${{ github.event.inputs.version }}
- name: Create pull request
uses: thomaseizinger/create-pull-request@1.2.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
head: release/${{ github.event.inputs.version }}
base: main
title: Release version ${{ github.event.inputs.version }}
reviewers: ${{ github.actor }}
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 }}.
The changelog and project version have been updated in this commit: ${{ steps.make-commit.outputs.commit }}.