-
Notifications
You must be signed in to change notification settings - Fork 2
67 lines (58 loc) · 1.87 KB
/
CI.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
# This is a basic workflow to help you get started with Actions
name: CI
on:
push:
branches: [ master ]
workflow_dispatch:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
check_version:
name: Check Version
runs-on: ubuntu-latest
outputs:
git_tag_name: ${{ steps.tag_check.outputs.git_tag_name }}
steps:
- uses: actions/checkout@v2 # https://github.com/actions/checkout
- uses: CumulusDS/[email protected]
id: get_package_version
with:
file: pubspec.yaml
version: version
# debug
- name: Output package version
run: echo 'version:' ${{ steps.get_package_version.outputs.version }}
- uses: dudo/[email protected]
id: tag_check
with:
version: ${{ steps.get_package_version.outputs.version }}
git_tag_prefix: v
push_tag:
name: Push Tag
needs: check_version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2 # https://github.com/actions/checkout
- name: Bump version and push tag
uses: anothrNick/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CUSTOM_TAG: ${{ needs.check_version.outputs.git_tag_name }}
publish_pub:
name: Publish new Pub version
needs: check_version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Write version
uses: DamianReeves/[email protected]
with:
path: lib/src/utils/version.g.dart
contents: String version = "${{ needs.check_version.outputs.git_tag_name }}";
- name: Publish Dart/Flutter package
uses: sakebook/[email protected]
with:
credential: ${{ secrets.PUB_PUBLISHER_CREDENTIAL_JSON }}
flutter_package: false
skip_test: true
dry_run: false