Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 44 additions & 17 deletions .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- default
- 'releases/**'
- 'release/**'
paths:
- '.github/**/*android.yml'
- 'BrickController2/*.props'
Expand All @@ -14,7 +14,7 @@ on:
pull_request:
branches:
- default
- 'releases/**'
- 'release/**'
paths:
- '.github/**/*android.yml'
- 'BrickController2/*.props'
Expand All @@ -29,12 +29,14 @@ on:
permissions:
contents: read

env:
TARGET_FRAMEWORK: 'net10.0-android'
PUBLISH_TRIMMED: ${{ (github.event_name == 'release' && github.event.action == 'published') }}

jobs:
build-android:
runs-on: windows-2025
name: BrickController Android Build
env:
APP_DISPLAY_VERSION: ""

steps:

Expand All @@ -47,6 +49,10 @@ jobs:
- name: Install .NET MAUI Workload
run: dotnet workload install maui-android

- name: Get App Version from Build Properties
shell: bash
run: echo "APP_VERSION=$(sed -n 's|.*<ApplicationDisplayVersion>\(.*\)</ApplicationDisplayVersion>.*|\1|p' Directory.Build.props)" >> $GITHUB_ENV

- name: Find Current Release Info
if: github.event_name == 'release' && github.event.action == 'published'
id: get_release
Expand All @@ -56,38 +62,59 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set APP_DISPLAY_VERSION for release
if: github.event_name == 'release' && github.event.action == 'published'
shell: bash
run: echo "APP_DISPLAY_VERSION=$(echo '${{ fromJson(steps.get_release.outputs.data).tag_name }}')" >> $GITHUB_ENV

- name: Restore Dependencies
run: dotnet restore BrickController2/BrickController2.Android/BrickController2.Android.csproj
- name: Setup Android signing
shell: bash
run: (echo "${{secrets.KEYSTORE}}" | base64 --decode) > BrickController2/BrickController2.Android/keystore.jks
- name: Build MAUI Android
- name: Build MAUI Android (APK)
run: dotnet publish BrickController2/BrickController2.Android/BrickController2.Android.csproj `
-c Release `
-f ${{ env.TARGET_FRAMEWORK }} `
--no-restore `
-p:ApplicationVersion="${{ github.run_number }}" `
-p:AndroidSigningKeyPass=${{secrets.KEYSTORE_PASSWORD}} `
-p:AndroidSigningStorePass=${{secrets.KEYSTORE_PASSWORD}} `
-p:AndroidPackageFormat=apk
-p:PublishTrimmed=${{ env.PUBLISH_TRIMMED }}

- name: Build MAUI Android (AAB) for Release
if: github.event_name == 'release' && github.event.action == 'published'
run: dotnet publish BrickController2/BrickController2.Android/BrickController2.Android.csproj `
-c Release `
-f net10.0-android `
-f ${{ env.TARGET_FRAMEWORK }} `
--no-restore `
-p:ApplicationDisplayVersion="${{ env.APP_DISPLAY_VERSION }}" `
-p:ApplicationVersion="${{ github.run_number }}" `
-p:AndroidSigningKeyPass=${{secrets.KEYSTORE_PASSWORD}} `
-p:AndroidSigningStorePass=${{secrets.KEYSTORE_PASSWORD}}
-p:AndroidSigningStorePass=${{secrets.KEYSTORE_PASSWORD}} `
-p:AndroidPackageFormat=aab
-p:PublishTrimmed=${{ env.PUBLISH_TRIMMED }}
-p:RunAOTCompilation=${{ env.PUBLISH_TRIMMED }}

- name: Upload Android Artifact
uses: actions/upload-artifact@v4
with:
name: brickcontroller-android-ci-build
path: BrickController2/BrickController2.Android/bin/Release/net10.0-android/com.scn.BrickController2-Signed.apk
path: BrickController2/BrickController2.Android/bin/Release/${{ env.TARGET_FRAMEWORK }}/cz.vico.BrickController-Signed.apk

- name: Upload Artifact to Release
- name: Upload APK Artifact to Release
if: github.event_name == 'release' && github.event.action == 'published'
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ fromJson(steps.get_release.outputs.data).upload_url }}
asset_path: BrickController2/BrickController2.Android/bin/Release/net10.0-android/com.scn.BrickController2-Signed.apk
asset_name: BrickController2_${{env.APP_DISPLAY_VERSION}}.apk
asset_path: BrickController2/BrickController2.Android/bin/Release/${{ env.TARGET_FRAMEWORK }}/cz.vico.BrickController-Signed.apk
asset_name: BrickController_${{env.APP_VERSION}}.apk
asset_content_type: application/vnd.android.package-archive
env:
GITHUB_TOKEN: ${{ secrets.CI_RELEASE_ASSETS_PAT }}

- name: Upload AAB Artifact to Release
if: github.event_name == 'release' && github.event.action == 'published'
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ fromJson(steps.get_release.outputs.data).upload_url }}
asset_path: BrickController2/BrickController2.Android/bin/Release/${{ env.TARGET_FRAMEWORK }}/cz.vico.BrickController-Signed.aab
asset_name: BrickController_${{env.APP_VERSION}}.aab
asset_content_type: application/x-authorware-bin
env:
GITHUB_TOKEN: ${{ secrets.CI_RELEASE_ASSETS_PAT }}
4 changes: 2 additions & 2 deletions .github/workflows/build-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- default
- 'releases/**'
- 'release/**'
paths:
- '.github/**/*core.yml'
- 'BrickController2/*.props'
Expand All @@ -14,7 +14,7 @@ on:
pull_request:
branches:
- default
- 'releases/**'
- 'release/**'
paths:
- '.github/**/*core.yml'
- 'BrickController2/*.props'
Expand Down
138 changes: 138 additions & 0 deletions .github/workflows/build-ios.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
name: Build BrickController iOS

on:
push:
branches:
- default
- 'release/**'
paths:
- '.github/**/*ios.yml'
- 'BrickController2/*.props'
- 'BrickController2/*.sln'
- 'BrickController2/BrickController2/**'
- 'BrickController2/BrickController2.iOS/**'
pull_request:
branches:
- default
- 'release/**'
paths:
- '.github/**/*ios.yml'
- 'BrickController2/*.props'
- 'BrickController2/*.sln'
- 'BrickController2/BrickController2/**'
- 'BrickController2/BrickController2.iOS/**'
release:
types:
- published
workflow_dispatch:

permissions:
contents: read

env:
XCODE_VERSION: '26.2'
TARGET_FRAMEWORK: 'net10.0-ios'
TARGET_RUNTIME: 'ios-arm64'
IOS_TRIM_MODE: ${{ (github.event_name == 'release' && github.event.action == 'published') && 'Full' || 'None' }}

jobs:
build-ios:
runs-on: macos-26
name: BrickController iOS Build

steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x

- name: Install MAUI workload
run: dotnet workload install maui ios

- name: Set XCode Version
if: runner.os == 'macOS'
shell: bash
run: |
sudo xcode-select -s "/Applications/Xcode_${{ env.XCODE_VERSION }}.app"
echo "MD_APPLE_SDK_ROOT=/Applications/Xcode_${{ env.XCODE_VERSION }}.app" >> $GITHUB_ENV

- name: Verify Xcode version
run: xcodebuild -version

- name: Get App Version from Build Properties
shell: bash
run: echo "APP_VERSION=$(sed -n 's|.*<ApplicationDisplayVersion>\(.*\)</ApplicationDisplayVersion>.*|\1|p' Directory.Build.props)" >> $GITHUB_ENV

- name: Find Current Release Info
if: github.event_name == 'release' && github.event.action == 'published'
id: get_release
uses: octokit/request-action@v2.x
with:
route: GET /repos/${{ github.repository }}/releases/tags/${{ github.event.release.tag_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Import Code-Signing Certificates
uses: Apple-Actions/import-codesign-certs@v1
with:
p12-file-base64: ${{ secrets.APPLE_SIGNING_CERTIFICATE_BASE64 }}
p12-password: ${{ secrets.APPLE_SIGNING_CERTIFICATE_PASSWORD }}

- name: Download Apple Provisioning Profiles
uses: Apple-Actions/download-provisioning-profiles@v1
with:
bundle-id: 'cz.vico.brickcontroller'
issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }}
api-key-id: ${{ secrets.APPSTORE_KEY_ID }}
api-private-key: ${{ secrets.APPSTORE_PRIVATE_KEY }}

- name: List Keychain Certificates
run: security find-identity -v -p codesigning

- name: Restore Dependencies
run: dotnet restore BrickController2/BrickController2.iOS/BrickController2.iOS.csproj
- name: Build MAUI iOS
run: >-
dotnet publish BrickController2/BrickController2.iOS/BrickController2.iOS.csproj
--no-restore
-c Release
-f ${{ env.TARGET_FRAMEWORK }}
-r ${{ env.TARGET_RUNTIME }}
-p:ApplicationVersion="${{ github.run_number }}"
-p:ArchiveOnBuild=true
-p:BuildIpa=true
-p:CodesignKey="iPhone Distribution"
-p:CodesignProvision=Automatic
-p:EnableAssemblyILStripping=false
-p:MtouchLink=${{ env.IOS_TRIM_MODE }}

- name: List build output
run: ls -R BrickController2/BrickController2.iOS/bin/Release/${{ env.TARGET_FRAMEWORK }}/${{ env.TARGET_RUNTIME }}/publish/

- name: Upload IOS Artifact
uses: actions/upload-artifact@v4
with:
name: brickcontroller-ios-ci-build
path: BrickController2/BrickController2.iOS/bin/Release/${{ env.TARGET_FRAMEWORK }}/${{ env.TARGET_RUNTIME }}/publish/BrickController2.iOS.ipa

- name: Upload Artifact to Release
if: github.event_name == 'release' && github.event.action == 'published'
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ fromJson(steps.get_release.outputs.data).upload_url }}
asset_path: BrickController2/BrickController2.iOS/bin/Release/${{ env.TARGET_FRAMEWORK }}/${{ env.TARGET_RUNTIME }}/publish/BrickController2.iOS.ipa
asset_name: BrickController_${{env.APP_VERSION}}.ipa
asset_content_type: application/octet-stream
env:
GITHUB_TOKEN: ${{ secrets.CI_RELEASE_ASSETS_PAT }}

- name: Upload app to TestFlight
if: github.event_name == 'release' && github.event.action == 'published'
uses: Apple-Actions/upload-testflight-build@v1
with:
app-path: 'BrickController2/BrickController2.iOS/bin/Release/${{ env.TARGET_FRAMEWORK }}/${{ env.TARGET_RUNTIME }}/publish/BrickController2.iOS.ipa'
issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }}
api-key-id: ${{ secrets.APPSTORE_KEY_ID }}
api-private-key: ${{ secrets.APPSTORE_PRIVATE_KEY }}

30 changes: 8 additions & 22 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- default
- 'releases/**'
- 'release/**'
paths:
- '.github/**/*windows.yml'
- 'BrickController2/*.props'
Expand All @@ -14,7 +14,7 @@ on:
pull_request:
branches:
- default
- 'releases/**'
- 'release/**'
paths:
- '.github/**/*windows.yml'
- 'BrickController2/*.props'
Expand All @@ -36,9 +36,6 @@ jobs:
build-winui:
runs-on: windows-2025
name: BrickController WinUI Build
env:
APP_DISPLAY_VERSION: ""
APP_PACKAGE_VERSION: ""

steps:
- uses: actions/checkout@v4
Expand All @@ -50,6 +47,10 @@ jobs:
- name: Install .NET MAUI Workload
run: dotnet workload install maui-windows

- name: Get App Version from Build Properties
shell: bash
run: echo "APP_VERSION=$(sed -n 's|.*<ApplicationDisplayVersion>\(.*\)</ApplicationDisplayVersion>.*|\1|p' Directory.Build.props)" >> $GITHUB_ENV

- name: Find Current Release Info
if: github.event_name == 'release' && github.event.action == 'published'
id: get_release
Expand All @@ -59,19 +60,6 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set app version for release
if: github.event_name == 'release' && github.event.action == 'published'
shell: bash
run: |
TAG_NAME=$(echo '${{ fromJson(steps.get_release.outputs.data).tag_name }}')
# Split the tag into parts, remove leading zeros and add missing parts as zeros
IFS='.' read -r -a VERSION_PARTS <<< "$TAG_NAME"
for i in "${!VERSION_PARTS[@]}"; do
VERSION_PARTS[$i]=$(echo "${VERSION_PARTS[$i]}" | sed 's/^0*//')
done
echo "APP_DISPLAY_VERSION=$TAG_NAME" >> $GITHUB_ENV
echo "APP_PACKAGE_VERSION=${VERSION_PARTS[0]:-0}.${VERSION_PARTS[1]:-0}.${VERSION_PARTS[2]:-0}.${VERSION_PARTS[3]:-0}" >> $GITHUB_ENV

- name: Decode Signing Certificate
run: |
echo "${{ secrets.SIGNING_CERTIFICATE_BASE_64_CONTENT }}" > cert.asc
Expand All @@ -88,9 +76,7 @@ jobs:
-c Release `
-r win-x64 `
-p:Platform=x64 `
-p:ApplicationDisplayVersion="${{ env.APP_DISPLAY_VERSION }}" `
-p:ApplicationVersion="0" `
-p:PackageVersion="${{ env.APP_PACKAGE_VERSION }}"
-p:ApplicationVersion="${{ github.run_number }}"

- name: Build MAUI WinUI App
run: dotnet publish ${{env.PROJECT_PATH}} `
Expand All @@ -113,7 +99,7 @@ jobs:
with:
upload_url: ${{ fromJson(steps.get_release.outputs.data).upload_url }}
asset_path: BrickController2\BrickController2.WinUI\bin\x64\Release\net10.0-windows10.0.19041.0\win-x64\AppPackages\BrickController2.WinUI_${{env.APP_PACKAGE_VERSION}}_Test\BrickController2.WinUI_${{env.APP_PACKAGE_VERSION}}_x64.msix
asset_name: BrickController2_${{env.APP_DISPLAY_VERSION}}.msix
asset_name: BrickController_${{env.APP_VERSION}}.msix
asset_content_type: application/vnd.ms-appx
env:
GITHUB_TOKEN: ${{ secrets.CI_RELEASE_ASSETS_PAT }}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@

<PropertyGroup>
<TargetFrameworks>net10.0-android</TargetFrameworks>
<SupportedOSPlatformVersion>23.0</SupportedOSPlatformVersion>
<TargetPlatformVersion>36.0</TargetPlatformVersion>
<OutputType>Exe</OutputType>
<SupportedOSPlatformVersion>23.0</SupportedOSPlatformVersion>
<TargetPlatformVersion>36.0</TargetPlatformVersion>
<OutputType>Exe</OutputType>
<RootNamespace>BrickController2.Droid</RootNamespace>
<AssemblyName>BrickController</AssemblyName>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<AndroidResgenClass>Resource</AndroidResgenClass>
<AndroidKeyStore>false</AndroidKeyStore>
Expand Down
2 changes: 1 addition & 1 deletion BrickController2/BrickController2.Android/MainActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
namespace BrickController2.Droid
{
[Activity(
Label = "BrickController2",
Label = "BrickController",
Icon = "@mipmap/ic_launcher",
Theme = "@style/MainTheme",
MainLauncher = true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.scn.BrickController2" android:installLocation="auto">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="cz.vico.brickcontroller" android:installLocation="auto">
<!--<uses-sdk android:targetSdkVersion="34" android:minSdkVersion="21" />-->
<uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" android:maxSdkVersion="30" />
Expand All @@ -14,5 +14,5 @@
<uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" />
<uses-feature android:name="android.hardware.bluetooth" android:required="true" />
<uses-feature android:name="android.hardware.bluetooth_le" android:required="true" />
<application android:label="BrickController2.Android" android:icon="@mipmap/ic_launcher"></application>
<application android:label="BrickController" android:icon="@mipmap/ic_launcher"></application>
</manifest>
Loading
Loading