-
Notifications
You must be signed in to change notification settings - Fork 3
75 lines (65 loc) · 2.05 KB
/
prepare-release.yaml
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
name: Prepare next release
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
env:
BOT_USER_NAME: eclipse-thingweb-bot
BOT_EMAIL: [email protected]
jobs:
prepare-release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate a changelog
id: git-cliff
uses: orhun/git-cliff-action@v3
with:
config: cliff.toml
args: --verbose --bump
env:
OUTPUT: CHANGELOG.md
GITHUB_REPO: ${{ github.repository }}
- name: Determine changes
uses: orhun/git-cliff-action@v3
id: git-cliff-changes
with:
config: cliff.toml
args: --verbose --bump --unreleased --strip header
env:
OUTPUT: CHANGES.md
GITHUB_REPO: ${{ github.repository }}
- name: Format and set new version number
id: version-number
run: |
NEW_VERSION=$(echo ${{ steps.git-cliff.outputs.version }}| cut -d'v' -f 2)
echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT
- name: Write new version to pubspec.yaml
run: |
NEW_VERSION=${{ steps.version-number.outputs.version }}
sed -i "/^\(^version: \).*/s//\1$NEW_VERSION/" pubspec.yaml
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.BOT_TOKEN }}
commit-message: "chore(release): prepare release ${{ steps.version-number.outputs.version }}"
committer: ${{ env.BOT_USER_NAME }} <${{ env.BOT_EMAIL }}>
author: ${{ env.BOT_USER_NAME }} <${{ env.BOT_EMAIL }}>
signoff: true
branch: next-release
delete-branch: true
title: 'chore(release): prepare release ${{ steps.version-number.outputs.version }}'
body-path: CHANGES.md
labels: |
release
draft: true
add-paths: |
pubspec.yaml
CHANGELOG.md