-
Notifications
You must be signed in to change notification settings - Fork 18
71 lines (66 loc) · 2.02 KB
/
Copy pathmaster.yml
File metadata and controls
71 lines (66 loc) · 2.02 KB
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
name: Package Publish
on:
push:
branches: [ master ]
jobs:
check_version:
runs-on: ubuntu-latest
name: 'Check Version Tag'
steps:
- uses: actions/checkout@v1
- name: 'Get Latest Version'
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@master"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
continue-on-error: true
- name: 'Print Latest Version'
run: echo ${{ steps.previoustag.outputs.tag }}
- name: 'Get New Version'
id: config
uses: CumulusDS/get-yaml-paths-action@v0.0.3
with:
file: pubspec.yaml
version_name: version
- name: 'Print New Version'
run: echo ${{ steps.config.outputs.version_name }}
- name: The version from your pubspec.yaml is the same as Master, Please update the version
if: steps.config.outputs.version_name == steps.previoustag.outputs.tag
run: exit 1
- shell: bash
run: |
echo ${{ steps.config.outputs.version_name }} > version.txt
- name: 'Upload New Version'
uses: actions/upload-artifact@v1
with:
name: home
path: version.txt
publish:
needs: [check_version]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: 'Publish Package'
uses: ilteoood/actions-flutter-pub-publisher@master
with:
credential: ${{secrets.CREDENTIAL_JSON}}
flutter_package: true
skip_test: true
dry_run: false
tag:
needs: [publish]
name: 'Tag Version'
runs-on: ubuntu-latest
steps:
- name: 'Download New Version'
uses: actions/download-artifact@v1
with:
name: home
- name: Set and Tag the new version
shell: bash
run: echo "::set-env name=RELEASE_VERSION::$(cat home/version.txt)"
- uses: tvdias/github-tagger@v0.0.1
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
tag: ${{env.RELEASE_VERSION}}