-
Notifications
You must be signed in to change notification settings - Fork 2
90 lines (80 loc) · 3.43 KB
/
create_release_pr.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
---
# See: https://flutter.dev/desktop#distribution
# REF: https://github.com/flutter/gallery/blob/master/.github/workflows/release.yml
name: Create PR to prepare for Release
on:
workflow_dispatch:
inputs:
version_bump_part:
type: choice
description: 'version bump part'
default: minor
options:
- patch
- minor
- major
required: true
release_note_ja_for_macos:
type: string
description: '[ja] release note for macos'
default: '安定性向上のための軽微な改善を行いました。'
required: true
release_note_en_for_macos:
type: string
description: '[en] release note for macos'
default: 'minor improvement of stability.'
required: true
jobs:
create_release_pr:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2.18.0
- name: setup flutter channel
shell: bash
run: ./scripts/setup_flutter.sh
- name: setup flutter desktop
shell: bash
run: ${{ matrix.setup_for_flutter_desktop_script }}
- name: doctor
run: flutter doctor -v
- name: install dependencies
run: flutter pub get
- name: bump version
run: dart run cider bump ${{ github.event.inputs.version_bump_part }} --bump-build
- name: inject current version
run: echo "CURRENT_VERSION=$(dart run cider version)" >> $GITHUB_ENV
- name: update release note
run: |
echo ${{ github.event.inputs.release_note_ja_for_macos }} > macos/fastlane/metadata/ja/release_notes.txt
echo ${{ github.event.inputs.release_note_en_for_macos }} > macos/fastlane/metadata/en-US/release_notes.txt
# See: https://github.com/peter-evans/create-pull-request/tree/master#reference-example
- name: create PR
id: create_pull_request
uses: peter-evans/create-pull-request@v7
with:
# See: https://github.com/peter-evans/create-pull-request/blob/master/docs/concepts-guidelines.md#triggering-further-workflow-runs
# See: https://github.com/peter-evans/create-pull-request/issues/48#issuecomment-537478081
token: ${{ secrets.PAT }}
# See: https://github.com/peter-evans/create-pull-request/issues/593
committer: GitHub <noreply@github.com>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
commit-message: 'Prepare for new Release ${{ env.CURRENT_VERSION }}'
title: 'Prepare for new Release `${{ env.CURRENT_VERSION }}`'
body: |
Auto-generated by [create-pull-request](https://github.com/peter-evans/create-pull-request)
---
See: https://github.com/peter-evans/create-pull-request/blob/master/docs/concepts-guidelines.md#triggering-further-workflow-runs
branch: prepare_for_release
delete-branch: true
labels: |
prepare for release
# See: https://github.com/peter-evans/create-pull-request/tree/main#auto-merge
- name: enable auto-merge
if: steps.create_pull_request.outputs.pull-request-operation == 'created'
uses: peter-evans/enable-pull-request-automerge@v3
with:
token: ${{ secrets.PAT }}
pull-request-number: ${{ steps.create_pull_request.outputs.pull-request-number }}
merge-method: squash