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
28 changes: 18 additions & 10 deletions .github/workflows/release_android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,25 @@ jobs:
shell: bash
run: |
TAG="${{ github.event.release.tag_name }}"
VERSION="${TAG#v}"
IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION"
MAJOR=${MAJOR:-0}
MINOR=${MINOR:-0}
PATCH=${PATCH:-0}
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
exit 1
fi
YEAR="${BASH_REMATCH[1]}"
MONTH="${BASH_REMATCH[2]}"
DAY="${BASH_REMATCH[3]}"

# Android versionCode must be a positive integer
VERSION_CODE=$(( MAJOR * 1000000 + MINOR * 1000 + PATCH ))
# SemVer display version: YY.M.DOY (Resizetizer-safe 3-part version)
YY=$(( YEAR - 2000 ))
DOY=$(date -d "$YEAR-$MONTH-$DAY" +%j | sed 's/^0*//')

echo "APP_VERSION=$VERSION" >> $GITHUB_ENV
echo "APP_ANDROID_VERSION=$VERSION_CODE" >> $GITHUB_ENV
APP_DISPLAY_VERSION="$YY.$MONTH.$DOY"

# Android versionCode: monotonic integer YYYY*1000 + DOY
APP_ANDROID_VERSION=$(( YEAR * 1000 + DOY ))

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

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

$major = [int]($parts[0])
$minor = if ($parts.Length -gt 1) { [int]($parts[1]) } else { 0 }
$patch = if ($parts.Length -gt 2) { [int]($parts[2]) } else { 0 }
# SemVer display version: YY.M.DOY (Resizetizer-safe 3-part version)
$yy = $year - 2000
$date = Get-Date -Year $year -Month $month -Day $day
$doy = $date.DayOfYear
$displayVersion = "$yy.$month.$doy"

# Valid MSIX/Appx version: A.B.C.D where each part is 0..65535
$msixVersion = "$major.$minor.$patch.0"
# Valid MSIX/Appx version: YYYY.M.D.0 (each part 0..65535)
$msixVersion = "$year.$month.$day.0"

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

- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1.1
Expand Down Expand Up @@ -66,7 +73,7 @@ jobs:
dotnet publish TransactionProcessor.Mobile/TransactionProcessor.Mobile.csproj `
-c Release `
-f net10.0-windows10.0.19041.0 `
/p:ApplicationDisplayVersion=${{ env.APP_VERSION }} `
/p:ApplicationDisplayVersion=${{ env.APP_DISPLAY_VERSION }} `
/p:ApplicationVersion=${{ env.APP_MSIX_VERSION }} `
/p:AppxPackageSigningEnabled=true `
/p:PackageCertificateThumbprint="${{ secrets.WINDOWSSIGNINGCERTTHUMBPRINT }}"
Expand Down
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
# TransactionMobile

![Alt](https://repobeats.axiom.co/api/embed/8c4c40e2db665c43af4c4e1014a3dca92fe330aa.svg "Repobeats analytics image")

## Release versioning

Releases are tagged in calendar format: **`vYYYY.M.D`** (e.g. `v2026.4.1`).

The release workflows derive three version values from this tag automatically.

| Value | Formula | Example (`v2026.4.1`, DOY = 91) |
|---|---|---|
| **ApplicationDisplayVersion** (SemVer 3-part) | `YY.M.DOY` | `26.4.91` |
| **Windows MSIX/Appx package version** | `YYYY.M.D.0` | `2026.4.1.0` |
| **Android versionCode** | `YYYY * 1000 + DOY` | `2026091` |

Where:
- `YY = YYYY - 2000`
- `M = month number` (1–12)
- `D = day of month` (1–31)
- `DOY = day-of-year` (1–366)

### Key properties

- **ApplicationDisplayVersion** is a valid 3-part SemVer-like version, satisfying `Microsoft.Maui.Resizetizer` validation requirements.
- **Windows package version** uses the full 4-part `YYYY.M.D.0` format required by MSIX/Appx.
- **Android versionCode** is a monotonically increasing integer across all releases.

### Creating a release

Tag format: `vYYYY.M.D` (single or double digit month/day both accepted).

Example tags: `v2026.4.1`, `v2026.12.31`, `v2027.1.5`
Loading