-
Notifications
You must be signed in to change notification settings - Fork 10
55 lines (51 loc) · 2.21 KB
/
ios-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
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
#src: https://www.andreasnesheim.no/setting-up-ci-for-your-net-maui-ios-app-with-github-actions/
name: Build iOS
on:
push:
branches-ignore: [main]
jobs:
build:
runs-on: macos-15
env:
KEYCHAIN: job-${{ github.job }}-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Put distribution cert
env: # Or as an environment variable
APPLE_DISTRIBUTION_CERT_P12_BASE64: ${{ secrets.APPLE_DISTRIBUTION_CERT_P12_BASE64 }}
run: echo "${APPLE_DISTRIBUTION_CERT_P12_BASE64}" | base64 -d > liftlog.p12
- name: Import Code-Signing Certificates
uses: Apple-Actions/import-codesign-certs@v3
with:
p12-filepath: "liftlog.p12"
p12-password: ${{ secrets.APPLE_DISTRIBUTION_CERT_PASS }}
keychain: ${{ env.KEYCHAIN }}
- name: Download Apple Provisioning Profiles
id: provision
uses: Apple-Actions/download-provisioning-profiles@v3
with:
bundle-id: "com.limajuice.liftlog"
issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }}
api-key-id: ${{ secrets.APPSTORE_KEY_ID }}
api-private-key: ${{ secrets.APPSTORE_PRIVATE_KEY }}
- name: Setup MAUI
run: dotnet workload install maui
- name: Build Tailwind
run: npm i && npm run build
working-directory: ./LiftLog.Ui
- name: Build
run: 'dotnet publish -c Release -f:net9.0-ios -p:ArchiveOnBuild=true -p:RuntimeIdentifier=ios-arm64 -p:CodesignKey="${{ secrets.APPLE_CODESIGN_KEY_NAME }}" -p:CodesignProvision="LiftLog"'
working-directory: ./LiftLog.Maui
- name: Delete keychain
if: always() # Always run this step to ensure the keychain is properly disposed of for self hosted runners
run: |
security delete-keychain "${{ env.KEYCHAIN }}".keychain