-
Notifications
You must be signed in to change notification settings - Fork 39
68 lines (57 loc) · 1.85 KB
/
publisher.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
name: Flutter Publisher
on:
workflow_dispatch:
push:
branches: [main]
paths:
- .github/workflows/publisher.yml
- json_theme/pubspec.yaml
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
- name: Run Codegen
run: |
flutter packages get
dart run build_runner build --delete-conflicting-outputs -v
working-directory: json_theme
- name: Validate
uses: peiffer-innovations/actions-flutter-validate@v1
with:
path: json_theme
- name: Checkout Schemas
uses: actions/checkout@v3
with:
repository: peiffer-innovations/flutter_json_schemas
token: ${{ secrets.REPO_TOKEN }}
fetch-depth: 0
ref: gh-pages
path: schemas
- name: Update Schemas
run: |
git config --global user.email "[email protected]"
git config --global user.name "action"
git config --global url."https://action:${{secrets.REPO_TOKEN}}@github.com/".insteadOf https://github.com/
rm -rf ../schemas/schemas/json_theme
mkdir ../schemas/schemas/json_theme
cp output/* ../schemas/schemas/json_theme
cd ../schemas
git add .
git commit --allow-empty -m "json_theme: schema update"
git push origin HEAD:gh-pages
cd ..
working-directory: json_theme
- name: Publish
uses: peiffer-innovations/[email protected]
with:
credentials: ${{ secrets.CREDENTIAL_JSON }}
path: json_theme
- uses: peiffer-innovations/actions-dart-version-autotag@v2
with:
path: json_theme
token: ${{ secrets.REPO_TOKEN }}