-
Notifications
You must be signed in to change notification settings - Fork 215
67 lines (55 loc) · 1.52 KB
/
release.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
name: release
on:
workflow_dispatch:
inputs:
version:
description: "Version to bump"
required: true
type: choice
options:
- major
- minor
- patch
env:
VERSION_BUMP: ${{ github.event.inputs.version }}
jobs:
release:
if: ${{ github.ref == 'refs/heads/master' }}
runs-on: ubuntu-latest
steps:
- name: Setup actions
uses: actions/checkout@v3
- name: Setup flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
cache: true
- name: Setup cider
run: dart pub global activate cider
- name: Install dependencies
run: flutter pub get
- name: Run tests
run: flutter test
- name: Bump and release version
run: |
cider bump ${{ env.VERSION_BUMP }}
cider release
- name: Get new version
run: echo "VERSION=$(cider version)" >> $GITHUB_ENV
- name: Commit version increase
uses: EndBug/add-and-commit@v9
with:
message: "chore: increase version"
default_author: github_actions
add: |
pubspec.yaml
CHANGELOG.md
- name: Get version changelog
run: |
echo "$(cider describe ${{ env.VERSION }} --only-body)" > changes
- name: Create release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ env.VERSION }}
body_path: changes