Skip to content

2.20.4

2.20.4 #90

Workflow file for this run

# 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: Release iOS
on:
release:
types: [created]
jobs:
build:
runs-on: macos-14
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: 8.0.x
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- uses: mlilback/build-number@v1
name: Set build number
id: buildNumber
with:
base: 100
run-id: ${{github.run_number}}
- 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 UI # Seems that the typescript built files dont get copied to the publish folder unless we build the project first
run: dotnet build -c Release
working-directory: ./LiftLog.Ui
- name: Build
run: 'dotnet publish -c Release -f:net8.0-ios -p:ArchiveOnBuild=true -p:RuntimeIdentifier=ios-arm64 -p:CodesignKey="${{ secrets.APPLE_CODESIGN_KEY_NAME }}" -p:CodesignProvision="LiftLog" -p:UseSentryCLI=true -p:ApplicationDisplayVersion=${{ github.event.release.name }} -p:ApplicationVersion=${{ steps.buildNumber.outputs.build-number }}'
working-directory: ./LiftLog.Maui
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
- name: Upload with altool
run: xcrun altool --upload-app -f LiftLog.Maui/bin/Release/net8.0-ios/ios-arm64/publish/LiftLog.Maui.ipa -t ios -p '${{secrets.APPLE_UPLOAD_PASS}}' -u ${{secrets.APPLE_UPLOAD_USER}}
- 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