-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (44 loc) · 1.93 KB
/
publish_pub.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
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Publish package to pub.dev
on:
release:
types:
- created
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get Current Release
id: current_release
uses: joutvhu/get-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Dart SDK
uses: dart-lang/setup-dart@v1
- name: Setup Credentials
uses: joutvhu/write-file@v1
with:
path: ~/.config/dart/pub-credentials.json
contents: ${{ secrets.PUB_CREDENTIALS }}
write_mode: overwrite
- name: Install dependencies for dioxide
if: ${{ endsWith(steps.current_release.outputs.tag_name, '_dioxide') || !contains(steps.current_release.outputs.tag_name, '_') }}
run: dart pub get
- name: Publish package for dioxide
if: ${{ endsWith(steps.current_release.outputs.tag_name, '_dioxide') || !contains(steps.current_release.outputs.tag_name, '_') }}
run: dart pub publish -f
- name: Copy README file to generator
if: ${{ endsWith(steps.current_release.outputs.tag_name, '_generator') || !contains(steps.current_release.outputs.tag_name, '_') }}
run: cp -r ./README.md ./generator/
- name: Install dependencies for generator
if: ${{ endsWith(steps.current_release.outputs.tag_name, '_generator') || !contains(steps.current_release.outputs.tag_name, '_') }}
run: dart pub get
working-directory: generator
- name: Publish package for generator
if: ${{ endsWith(steps.current_release.outputs.tag_name, '_generator') || !contains(steps.current_release.outputs.tag_name, '_') }}
run: dart pub publish -f
working-directory: generator