Skip to content

Create PR to prepare for Release #98

Create PR to prepare for Release

Create PR to prepare for Release #98

---
# 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/[email protected]
- 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@v6
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 <[email protected]>
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