-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
142 lines (127 loc) · 2.91 KB
/
.drone.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
---
kind: pipeline
type: docker
name: default
trigger:
event:
- push
volumes:
- name: cache
temp: { }
- name: dist
temp: { }
environment:
PUB_CACHE: /cache/dart
steps:
- name: deps
image: dart:2.19.6-sdk
volumes:
- name: cache
path: /cache
commands:
- dart pub get
- name: build
image: dart:2.19.6-sdk
volumes:
- name: cache
path: /cache
- name: dist
path: /dist
commands:
- dart run build_runner build --delete-conflicting-outputs -v
depends_on:
- deps
- name: slack
image: plugins/slack
settings:
webhook:
from_secret: SLACK_WEBHOOK
channel: cicd
link_names: true
template: >
{{#success build.status}}
The {{ repo.owner }}/{{ repo.name }} build <{{ build.link }}| {{build.number}} ↗> is succeeded! Thanks <@{{build.author}}>
{{else}}
The {{ repo.owner }}/{{ repo.name }} build <{{ build.link }}| {{build.number}} ↗> is broken! Blame <@{{build.author}}>
{{/success}}
depends_on:
- build
when:
status: [ success, failure ]
---
kind: pipeline
type: docker
name: "publish: pub.dev"
trigger:
event:
- tag
volumes:
- name: cache
temp: { }
- name: dist
temp: { }
environment:
PUB_CACHE: /cache/dart
steps:
- name: deps
image: dart:2.19.6-sdk
volumes:
- name: cache
path: /cache
commands:
- dart pub get
- name: build
image: dart:2.19.6-sdk
volumes:
- name: cache
path: /cache
- name: dist
path: /dist
commands:
- dart run build_runner build --delete-conflicting-outputs -v
depends_on:
- deps
- name: validate
image: dart:2.19.6-sdk
volumes:
- name: cache
path: /cache
- name: dist
path: /dist
commands:
- dart pub publish -n
depends_on:
- build
- name: publish
image: dart:2.19.6-sdk
environment:
PUB_DEV_CREDENTIALS:
from_secret: PUB_DEV_CREDENTIALS
volumes:
- name: cache
path: /cache
- name: dist
path: /dist
commands:
- mkdir -p $PUB_CACHE
- echo $PUB_DEV_CREDENTIALS >> $PUB_CACHE/credentials.json
- dart pub publish -f
depends_on:
- validate
- name: slack
image: plugins/slack
settings:
webhook:
from_secret: SLACK_RELEASE_WEBHOOK
link_names: true
icon_url: https://unsplash.it/256/256/?random
template: >
{{#success build.status}}
✔ Publish to pub.dev <{{ build.link }}| {{ repo.owner }}/{{ repo.name }}:{{ build.tag }} ↗> is succeed!! Thanks @{{build.author}}
{{else}}
:x: Publish to pub.dev <{{ build.link }}| {{ repo.owner }}/{{ repo.name }}:{{ build.tag }} ↗> is failed! Blame @{{build.author}}
{{/success}}
when:
status: [ success, failure ]
depends_on:
- publish