forked from comigor/artemis
-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (89 loc) · 2.7 KB
/
push.yaml
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
on:
push:
branches:
- master
- beta
name: CI
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1.3
with:
sdk: stable
- id: install
name: Install dependencies
run: dart pub get
- name: Check formatting
if: always() && steps.install.outcome == 'success'
run: dart format --set-exit-if-changed .
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1.3
with:
sdk: stable
- id: install
name: Install dependencies
run: dart pub get
- name: Test
if: always() && steps.install.outcome == 'success'
run: dart test
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1.3
with:
sdk: stable
- id: install
name: Install dependencies
run: dart pub get
- name: Analyze
if: always() && steps.install.outcome == 'success'
run: dart analyze
create-tag-and-release:
needs:
- lint
- test
- analyze
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/beta'
steps:
- uses: actions/checkout@master
- id: check_version_and_changelog
name: Check if version on pubspec.yaml was changed and if there's an entry for this new version on CHANGELOG
uses: comigor/actions/check-version-and-changelog@master
with:
base_ref: "${{ github.ref }}"
- name: Push tag
uses: anothrNick/github-tag-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CUSTOM_TAG: "v${{ steps.check_version_and_changelog.outputs.package_version }}"
- name: Create release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: "v${{ steps.check_version_and_changelog.outputs.package_version }}"
release_name: "Release v${{ steps.check_version_and_changelog.outputs.package_version }}"
deploy:
needs: create-tag-and-release
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/beta'
steps:
- uses: actions/checkout@master
- uses: dart-lang/setup-dart@v1.3
with:
sdk: stable
- id: install
name: Install dependencies
run: dart pub get
- name: Publish to pub.dev
run: |
mkdir -p ~/.config/dart
echo '${{ secrets.PUB_CREDENTIALS }}' > ~/.config/dart/pub-credentials.json
dart pub publish --force