Skip to content
Merged
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
20 changes: 9 additions & 11 deletions .github/workflows/release_android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,23 @@ jobs:
shell: bash
run: |
TAG="${{ github.event.release.tag_name }}"
if [[ ! "$TAG" =~ ^v([0-9]{4})\.([0-9]{1,2})\.([0-9]{1,2})$ ]]; then
echo "Tag '$TAG' does not match expected format vYYYY.M.D" >&2
if [[ ! "$TAG" =~ ^v?([0-9]{4})\.([0-9]{1,2})\.([0-9]{1,2})$ ]]; then
echo "Tag '$TAG' does not match expected format YYYY.M.D (e.g. 2026.4.9)" >&2
exit 1
fi
YEAR="${BASH_REMATCH[1]}"
MONTH="${BASH_REMATCH[2]}"
DAY="${BASH_REMATCH[3]}"

# SemVer display version: YY.M.DOY (Resizetizer-safe 3-part version)
YY=$(( YEAR - 2000 ))
DOY=$(date -d "$YEAR-$MONTH-$DAY" +%j | sed 's/^0*//')
# SemVer display version: YYYY.M.D (3-part, consistent with Windows)
APP_DISPLAY_VERSION="$YEAR.$MONTH.$DAY"

APP_DISPLAY_VERSION="$YY.$MONTH.$DOY"

# Android versionCode: monotonic integer YYYY*1000 + DOY
APP_ANDROID_VERSION=$(( YEAR * 1000 + DOY ))
# MAUI ApplicationVersion must be a monotonically increasing integer (e.g. 20260409)
# Uses the same formula as Windows so the version is consistent across platforms
APP_VERSION=$(( YEAR * 10000 + MONTH * 100 + DAY ))

echo "APP_DISPLAY_VERSION=$APP_DISPLAY_VERSION" >> $GITHUB_ENV
echo "APP_ANDROID_VERSION=$APP_ANDROID_VERSION" >> $GITHUB_ENV
echo "APP_VERSION=$APP_VERSION" >> $GITHUB_ENV

- name: Install KVM and Android SDK (x86)
run: |
Expand Down Expand Up @@ -80,7 +78,7 @@ jobs:
-c Release \
--no-restore \
/p:ApplicationDisplayVersion=${{ env.APP_DISPLAY_VERSION }} \
/p:ApplicationVersion=${{ env.APP_ANDROID_VERSION }} \
/p:ApplicationVersion=${{ env.APP_VERSION }} \
/p:AndroidSigningKeyStore=$(pwd)/android_keystore.jks \
/p:AndroidSigningKeyAlias=${{ secrets.ANDROID_KEY_ALIAS }} \
/p:AndroidSigningKeyPass=${{ secrets.ANDROID_KEY_PASSWORD }} \
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/release_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,25 @@ jobs:
shell: powershell
run: |
$tag = "${{ github.event.release.tag_name }}"
if ($tag -notmatch '^v(\d{4})\.(\d{1,2})\.(\d{1,2})$') {
Write-Error "Tag '$tag' does not match expected format vYYYY.M.D"
if ($tag -notmatch '^v?(\d{4})\.(\d{1,2})\.(\d{1,2})$') {
Write-Error "Tag '$tag' does not match expected format YYYY.M.D (e.g. 2026.4.9)"
exit 1
}
$year = [int]$Matches[1]
$month = [int]$Matches[2]
$day = [int]$Matches[3]

# SemVer display version: YY.M.D (3-part, widely accepted)
$yy = $year - 2000
$displayVersion = "$yy.$month.$day"
# SemVer display version: YYYY.M.D (3-part, full year to avoid edge cases)
$displayVersion = "$year.$month.$day"

# Valid MSIX/Appx version: YYYY.M.D.0 (each part 0..65535)
# MAUI ApplicationVersion must be a monotonically increasing integer (e.g. 20260409)
$appVersion = ($year * 10000) + ($month * 100) + $day

# Valid MSIX/Appx package version: YYYY.M.D.0 (each part 0..65535)
$msixVersion = "$year.$month.$day.0"

echo "APP_DISPLAY_VERSION=$displayVersion" >> $env:GITHUB_ENV
echo "APP_VERSION=$appVersion" >> $env:GITHUB_ENV
echo "APP_MSIX_VERSION=$msixVersion" >> $env:GITHUB_ENV

- name: Setup MSBuild
Expand Down Expand Up @@ -72,7 +75,8 @@ jobs:
-c Release `
-f net10.0-windows10.0.19041.0 `
/p:ApplicationDisplayVersion=${{ env.APP_DISPLAY_VERSION }} `
/p:ApplicationVersion=${{ env.APP_MSIX_VERSION }} `
/p:ApplicationVersion=${{ env.APP_VERSION }} `
/p:AppxPackageVersion=${{ env.APP_MSIX_VERSION }} `
/p:AppxPackageSigningEnabled=true `
/p:PackageCertificateThumbprint="${{ secrets.WINDOWSSIGNINGCERTTHUMBPRINT }}"

Expand Down
Loading