-
Notifications
You must be signed in to change notification settings - Fork 12
152 lines (146 loc) · 5.12 KB
/
master-workflow.yaml
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
143
144
145
146
147
148
149
150
151
152
name: Master workflow
on:
workflow_dispatch:
push:
branches:
- master
paths-ignore:
- '.gitignore'
- '.metadata'
- '*.md'
- 'android/fastlane/**'
- 'ios/fastlane/**'
- '.github/**'
- '.githooks/**'
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
env:
APP_NAME: 'notre_dame'
jobs:
##############################################################
# Setup
##############################################################
tag_validation:
runs-on: ubuntu-latest
outputs:
description: "The version in the pubspec.yaml file."
version: ${{ steps.tag_validation.outputs.version }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/composite/tag-validation
id: tag_validation
testing:
name: Tests and checks
runs-on: ubuntu-latest
outputs:
coverage: ${{ steps.coverage.outputs.percentage }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/composite/flutter-setup
with:
encrypted-signets-api-cert-password: ${{ secrets.ENCRYPTED_SIGNETS_API_CERT_PASSWORD }}
encrypted-google-service-password: ${{ secrets.ENCRYPTED_GOOGLE_SERVICE_PASSWORD }}
encrypted-etsmobile-keystore-password: ${{ secrets.ENCRYPTED_ETSMOBILE_KEYSTORE_PASSWORD }}
encrypted-keystore-properties-password: ${{ secrets.ENCRYPTED_KEYSTORE_PROPERTIES_PASSWORD }}
- uses: ./.github/composite/tests
with:
format: false
coverage:
name: Update coverage
needs:
- testing
runs-on: ubuntu-latest
steps:
- name: Download coverage file
uses: actions/download-artifact@v4
with:
name: lcov.info
- name: Update badge coverage
uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST_COVERAGE_BADGE_TOKEN }}
gistID: ${{ secrets.GIST_ID_COVERAGE_BADGE }}
filename: notre_dame_master_badge_coverage.json
label: Code coverage
message: ${{ needs.testing.outputs.coverage }}
namedLogo: flutter
color: green
##############################################################
# Build
##############################################################
build:
name: Create ${{ matrix.target }} build
runs-on: ${{ matrix.os }}
strategy:
matrix:
target: [ iOS, Android ]
include:
- os: macos-latest
target: iOS
build_target: ios
build_args: --no-codesign
build_path: build/ios/iphoneos
asset_extension: zip
asset_content_type: application/zip
- os: ubuntu-latest
target: Android
build_target: apk
build_args: ''
build_path: build/app/outputs/apk/release
asset_extension: apk
asset_content_type: application/zip
# Disable fail-fast as we want results from all even if one fails.
fail-fast: false
needs:
- testing
steps:
- uses: actions/checkout@v4
- uses: ./.github/composite/flutter-setup
with:
encrypted-signets-api-cert-password: ${{ secrets.ENCRYPTED_SIGNETS_API_CERT_PASSWORD }}
encrypted-google-service-password: ${{ secrets.ENCRYPTED_GOOGLE_SERVICE_PASSWORD }}
encrypted-etsmobile-keystore-password: ${{ secrets.ENCRYPTED_ETSMOBILE_KEYSTORE_PASSWORD }}
encrypted-keystore-properties-password: ${{ secrets.ENCRYPTED_KEYSTORE_PROPERTIES_PASSWORD }}
target: ${{ matrix.target }}
- uses: ./.github/composite/ci-build
with:
target: ${{ matrix.target }}
build-target: ${{ matrix.build_target }}
build-args: ${{ matrix.build_args }}
build-path: ${{ matrix.build_path }}
asset-extension: ${{ matrix.asset_extension }}
asset-content-type: ${{ matrix.asset_content_type }}
app-name: ${{ env.APP_NAME }}
app-path: ${{ github.workspace }}/${{ env.APP_NAME }}_${{ matrix.target }}.${{ matrix.asset_extension }}
maps-api-key: ${{ secrets.MAPS_API_KEY }}
##############################################################
# Post-build
##############################################################
create_pre_release:
name: Create Github release
needs:
- tag_validation
- build
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Download iOS build
uses: actions/download-artifact@v4
with:
name: iOS
- name: Download Android build
uses: actions/download-artifact@v4
with:
name: Android
- name: Download build of Android and iOS
uses: actions/download-artifact@v4
with:
path: build
- name: Create pre-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create ${{ needs.tag_validation.outputs.version }} */** --title v${{ needs.tag_validation.outputs.version }} -R '${{ github.repository }}' --prerelease --generate-notes
working-directory: build