-
Notifications
You must be signed in to change notification settings - Fork 0
131 lines (112 loc) · 4.71 KB
/
ci-build.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
name: CI Build
on:
push:
branches: [ master ]
paths-ignore:
- '**/*.md'
- '**/*.gitignore'
- '**/*.gitattributes'
permissions:
contents: read
env:
DOTNET_NOLOGO: true # Disable the .NET logo
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true # Disable the .NET first time experience
DOTNET_CLI_TELEMETRY_OPTOUT: true # Disable sending .NET CLI telemetry
jobs:
# MAUI Android Build
build-android:
runs-on: windows-2022
name: Android Build
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Versioning
uses: dotnet/nbgv@master
id: nbgv
- name: Restore Dependencies
run: dotnet restore PursuitTimer
- name: Build MAUI Android
run: dotnet build PursuitTimer -c Release -f net9.0-android --no-restore /p:AndroidSigningKeyPass=${{ secrets.PLAYSTORE_PASS }} /p:AndroidSigningStorePass=${{ secrets.PLAYSTORE_PASS }}
- name: Publish MAUI Android
run: dotnet publish PursuitTimer -c Release -f net9.0-android --no-restore
- name: Upload Android Artifact
uses: actions/[email protected]
with:
name: android-ci-build
path: PursuitTimer/bin/Release/net9.0-android/*Signed.a*
- name: Publish to Play Store
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.APPSTORE_SERVICE_ACCOUNT }}
packageName: me.veloti.pursuittimer
releaseFiles: PursuitTimer/bin/Release/net9.0-android/publish/me.veloti.pursuittimer-Signed.aab
track: alpha
status: completed
# MAUI iOS Build
build-ios:
runs-on: macos-15
name: iOS Build
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 'latest-stable'
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Versioning
uses: dotnet/nbgv@master
id: nbgv
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9
- name: Install MAUI Workloads
run: |
dotnet workload install ios --ignore-failed-sources
dotnet workload install maui --ignore-failed-sources
- name: Restore Dependencies
run: dotnet restore PursuitTimer -r ios-arm64
- name: Import Code-Signing Certificates
uses: Apple-Actions/import-codesign-certs@v2
with:
p12-file-base64: ${{ secrets.CERTIFICATES_P12_BASE64 }}
#p12-filepath: 'DistributionCertVeloTimePursuitTimer.p12'
p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }}
- name: Download Apple Provisioning Profiles
uses: Apple-Actions/download-provisioning-profiles@v1
with:
bundle-id: 'me.veloti.pursuittimer'
issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }}
api-key-id: ${{ secrets.APPSTORE_KEY_ID }}
api-private-key: ${{ secrets.APPSTORE_PRIVATE_KEY }}
- name: Build MAUI iOS
run: dotnet build PursuitTimer -c Release -f net9.0-ios --no-restore -p:ApplicationVersion=${{ steps.nbgv.outputs.CloudBuildNumber }}
- name: Publish MAUI iOS
run: dotnet publish PursuitTimer -c Release -f:net9.0-ios -r ios-arm64 -p:ApplicationVersion=${{ steps.nbgv.outputs.CloudBuildNumber }}
- name: Upload iOS Artifact
uses: actions/[email protected]
with:
name: ios-ci-build
path: PursuitTimer/bin/Release/net9.0-ios/**/*.app/
- name: Upload iOS Package
uses: actions/[email protected]
with:
name: ios-ci-package
path: PursuitTimer/bin/Release/net9.0-ios/**/*.ipa
- name: 'Upload app to TestFlight'
uses: apple-actions/upload-testflight-build@v1
with:
app-type: ios
app-path: 'PursuitTimer/bin/Release/net9.0-ios/ios-arm64/publish/PursuitTimer.ipa'
issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }}
api-key-id: ${{ secrets.APPSTORE_KEY_ID }}
api-private-key: ${{ secrets.APPSTORE_PRIVATE_KEY }}
# - name: Make appstore key ready
# run: echo "${{ secrets.APPSTORE_PRIVATE_KEY }}" > Authkey_${{ secrets.APPSTORE_KEY_ID }}.p8
# - name: Publish to App Store
# env:
# API_PRIVATE_KEYS_DIR: .
# run: xcrun altool --upload-package PursuitTimer/bin/Release/net9.0-ios/ios-arm64/publish/PursuitTimer.ipa --type ios --apple-id 1630437751 --bundle-id me.velotimer.pursuittimer --apiKey ${{ secrets.APPSTORE_KEY_ID }} --apiIssuer ${{ secrets.APPSTORE_ISSUER_ID }} --bundle-version ${{ steps.nbgv.outputs.CloudBuildNumber }} --bundle-short-version-string ${{ steps.nbgv.outputs.SemVer2 }}