-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (47 loc) · 2.16 KB
/
example_app_release_pr.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
# Will create PR only if new version in root pubspec exists
name: Make example app release PR
on:
pull_request_target:
types:
- labeled
branches:
- main
jobs:
pull-request-creation:
if: contains(github.event.pull_request.labels.*.name, format('autorelease{0} tagged', ':'))
permissions:
pull-requests: write
contents: write
runs-on: ubuntu-latest
steps:
- name: Clone Repository
uses: actions/checkout@v4
- name: Read new build_name from root pubspec.yaml.
id: read_build_name
run: |
version=$(grep '^version:' pubspec.yaml | awk '{print $2}')
echo "Version found: $version"
echo "pubspec_build_name=$version" >> $GITHUB_OUTPUT
- name: Read current build_number from example pubspec.yaml
id: read_build_number
run: |
version=$(grep '^version:' example/pubspec.yaml | awk '{print $2}')
echo "Example version found: $version"
IFS='+' read -r build_name build_number <<< "$version"
new_build_number=$((build_number + 1))
echo "pubspec_build_number=$new_build_number" >> $GITHUB_OUTPUT
- name: Update version in example pubspec.yaml
run: |
sed -i "s/^version:.*/version: ${{ steps.read_build_name.outputs.pubspec_build_name }}+${{ steps.read_build_number.outputs.pubspec_build_number }} # automatically set by GH Action /" example/pubspec.yaml
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
commit-message: ${{ format('chore{0} example app release v{1}', ':', steps.read_build_name.outputs.pubspec_build_name) }}
branch: "chore/example-release"
title: ${{ format('Release example app v{0}', steps.read_build_name.outputs.pubspec_build_name) }}
body: |
Make changes for Example app release.
- Update pubspec version to ${{ steps.read_build_name.outputs.pubspec_build_name }}+${{ steps.read_build_number.outputs.pubspec_build_number }}
**Merging this PR will trigger the release into the enterprise app stores.**
labels: |
exampleAppRelease:pending