-
Notifications
You must be signed in to change notification settings - Fork 38
132 lines (115 loc) · 4.28 KB
/
changelog.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Changelog
on:
workflow_dispatch:
inputs:
update_mix:
type: boolean
description: whether to update mix
default: true
mix:
type: string
description: set specific version for mix
default: ""
update_mix_lint:
type: boolean
description: whether to update mix_lint
default: true
mix_lint:
type: string
description: set specific version for mix_lint
default: ""
update_mix_annotations:
type: boolean
description: whether to update mix_annotations
default: true
mix_annotations:
type: string
description: set specific version for mix_annotations
default: ""
update_mix_generator:
type: boolean
description: whether to update mix_generator
default: true
mix_generator:
type: string
description: set specific version for mix_generator
default: ""
update_remix:
type: boolean
description: whether to update remix
default: true
remix:
type: string
description: set specific version for remix
default: ""
jobs:
version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install FVM
shell: bash
run: |
curl -fsSL https://fvm.app/install.sh | bash
fvm use mincompat --force
- uses: kuhnroyal/flutter-fvm-config-action@v2
id: fvm-config-action
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }}
channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }}
- name: Flutter version
shell: bash
run: |
flutter --version
- name: Setup Melos
run: |
dart pub global activate melos
melos bs
- name: Configure Git User
run: |
git config --global user.name 'GitHub Action'
git config --global user.email '[email protected]'
- name: Creating the new version
run: |
git checkout -b release/package-versions
git push --set-upstream origin release/package-versions
ignored_packages=""
if [ "${{ github.event.inputs.update_mix }}" == "false" ]; then
ignored_packages="$ignored_packages --ignore=mix"
fi
if [ "${{ github.event.inputs.update_mix_lint }}" == "false" ]; then
ignored_packages="$ignored_packages --ignore=mix_lint"
fi
if [ "${{ github.event.inputs.update_mix_annotations }}" == "false" ]; then
ignored_packages="$ignored_packages --ignore=mix_annotations"
fi
if [ "${{ github.event.inputs.update_mix_generator }}" == "false" ]; then
ignored_packages="$ignored_packages --ignore=mix_generator"
fi
if [ "${{ github.event.inputs.update_remix }}" == "false" ]; then
ignored_packages="$ignored_packages --ignore=remix"
fi
packages_with_versions=""
if [ "${{ github.event.inputs.mix }}" != "" ]; then
packages_with_versions="$packages_with_versions -V mix:${{ github.event.inputs.mix }}"
fi
if [ "${{ github.event.inputs.mix_lint }}" != "" ]; then
packages_with_versions="$packages_with_versions -V mix_lint:${{ github.event.inputs.mix_lint }}"
fi
if [ "${{ github.event.inputs.mix_annotations }}" != "" ]; then
packages_with_versions="$packages_with_versions -V mix_annotations:${{ github.event.inputs.mix_annotations }}"
fi
if [ "${{ github.event.inputs.mix_generator }}" != "" ]; then
packages_with_versions="$packages_with_versions -V mix_generator:${{ github.event.inputs.mix_generator }}"
fi
if [ "${{ github.event.inputs.remix }}" != "" ]; then
packages_with_versions="$packages_with_versions -V remix:${{ github.event.inputs.remix }}"
fi
melos version $ignored_packages --yes --no-git-tag-version $packages_with_versions
git push --follow-tags
gh pr create --title "chore: version packages" --body "This PR was opened by the changelog GitHub Actions workflow" --reviewer leoafarias
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}