-
Notifications
You must be signed in to change notification settings - Fork 20
63 lines (61 loc) · 1.96 KB
/
push.yaml
File metadata and controls
63 lines (61 loc) · 1.96 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
on:
push:
branches:
- master
- beta
name: CI
jobs:
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
create-tag-and-release:
needs:
- test
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