-
Notifications
You must be signed in to change notification settings - Fork 6
75 lines (63 loc) · 1.92 KB
/
release.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
name: Release new version
run-name: ${{ github.ref_name }} published by ${{ github.event.head_commit.author.name }}
on:
push:
tags: ['v[0-9]+.[0-9]+.[0-9]+*']
env:
package_dir: ./package
example_dir: ./example
jobs:
publish:
name: Publish the package to pub.dev
permissions:
id-token: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Dart
uses: dart-lang/setup-dart@v1
- name: Install Flutter SDK
uses: subosito/flutter-action@v2
with:
channel: "stable"
- name: Flutter versioin
run: flutter --version
- name: Install dependencies
working-directory: ${{ env.package_dir }}
run: flutter pub get
- name: Analize
working-directory: ${{ env.package_dir }}
run: flutter analyze
- name: Dry run
working-directory: ${{ env.package_dir }}
run: flutter pub publish --dry-run
- name: Publish
working-directory: ${{ env.package_dir }}
if: success()
run: flutter pub publish --force
deploy-example:
name: Deploy the example app to GitHub Pages
needs: publish
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Flutter SDK
uses: subosito/flutter-action@v2
with:
channel: "stable"
- name: Install dependencies
working-directory: ${{ env.example_dir }}
run: flutter pub get
- name: Build web app
working-directory: ${{ env.example_dir }}
run: flutter build web --release --base-href "/${{ github.event.repository.name }}/"
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: success()
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ${{ env.example_dir }}/build/web