.NET #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
name: .NET | |
on: | |
workflow_dispatch: | |
inputs: | |
build_config: | |
description: 'How to build debug/release' | |
required: true | |
default: 'Release' | |
use_aab: | |
description: 'Create an AAB Artifact' | |
required: true | |
default: 'false' | |
jobs: | |
build: | |
env: | |
BUILD_CONFIG: ${{ github.event.inputs.build_config }} | |
SOLUTION: 'chdTour.sln' | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Maui | |
run: dotnet workload install maui | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Publish | |
run: | | |
$MAJOR=2 | |
$MINOR=2 | |
$YEAR=& Get-Date -UFormat "%y%j" | |
$HOUR=& Get-Date -format HHmm | |
$VERSION="$MAJOR.$MINOR.$YEAR.$HOUR" | |
dotnet publish src/chdTour.App/chdTour.App.csproj --no-restore --configuration ${{ env.BUILD_CONFIG }} --framework net8.0-android /p:ApplicationDisplayVersion=$VERSION /p:ApplicationVersion=${{ github.run_number}} /p:AndroidSigningKeyPass=${{secrets.CHDTOUR_KEYPASS}} /p:AndroidSigningStorePass=${{secrets.CHDTOUR_KEYPASS}} /p:AndroidKeyStore=true /p:AndroidSigningKeyStore=chdtour.keystore /p:AndroidSigningKeyAlias=chdTour /p:AndroidSigningKeyAlias=chdTour /p:AndroidVersionCode=${{github.run_number}} | |
- name: Upload APK Build Artifact | |
uses: actions/upload-artifact@v4.4.2 | |
with: | |
name: chdTour | |
path: ./**/bin/Release/**/publish/*.apk | |
- name: Upload AAB Build Artifact | |
if: ${{ github.event.inputs.use_aab == 'true' }} | |
uses: actions/upload-artifact@v4.4.2 | |
with: | |
name: chdTourAAB | |
path: ./**/bin/Release/**/publish/*.aab |