This repository has been archived by the owner on Mar 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
73 lines (59 loc) · 2.54 KB
/
draft-new-nectar-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
name: "Draft new release of nectar"
on:
workflow_dispatch:
inputs:
version:
description: 'The version you want to release.'
required: true
jobs:
draft-new-release:
name: "Draft a new release of nectar"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.BOTTY_GITHUB_TOKEN }}
- name: Create release branch
run: git checkout -b release/nectar/${{ github.event.inputs.version }}
- name: Update changelog
uses: thomaseizinger/keep-a-changelog-new-release@v1
with:
version: nectar-${{ github.event.inputs.version }}
changelogPath: nectar/CHANGELOG.md
- name: Initialize mandatory git config
run: |
git config user.name ${{ secrets.BOTTY_NAME }}
git config user.email ${{ secrets.BOTTY_EMAIL }}
- name: Bump version in Cargo.toml
uses: thomaseizinger/[email protected]
with:
version: ${{ github.event.inputs.version }}
manifest: nectar/Cargo.toml
- name: Update Cargo.lock
uses: actions-rs/cargo@v1
with:
command: update
args: --package nectar
- name: Commit changelog and manifest files
id: make-commit
run: |
curl -fsSL https://dprint.dev/install.sh | sh
dprint fmt
git add nectar/CHANGELOG.md nectar/Cargo.toml Cargo.lock
git commit --message "Prepare release nectar ${{ github.event.inputs.version }}"
echo "::set-output name=commit::$(git rev-parse HEAD)"
- name: Push new branch
run: git push origin release/nectar/${{ github.event.inputs.version }} --force
- name: Create pull request
uses: thomaseizinger/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.BOTTY_GITHUB_TOKEN }}
head: release/nectar/${{ github.event.inputs.version }}
base: master
title: Release version ${{ github.event.inputs.version }} of nectar
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 }}.
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.