Skip to content

New Crowdin updates #583

New Crowdin updates

New Crowdin updates #583

Workflow file for this run

name: Build
on:
push:
branches:
- master
- develop
pull_request:
branches: [ master ]
workflow_dispatch:
env:
FRAMEWORK: net8.0-android
CONFIGURATION: Release
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Android workload
run: dotnet workload install android
- name: Install Android platform tools
run: $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --install platform-tools
- name: Restore NuGet packages
run: dotnet restore
- name: Run tests
run: dotnet test --configuration $CONFIGURATION --no-restore --collect:"XPlat Code Coverage" --results-directory ./coverage AuthenticatorPro.Test/AuthenticatorPro.Test.csproj
- name: Publish Android
run: |
REF=$(echo $GITHUB_SHA | cut -c -7)
sed -i "s|package=\"me.jmh.authenticatorpro\"|package=\"me.jmh.authenticatorpro.$REF\"|g" AuthenticatorPro.Droid/Properties/AndroidManifest.xml
sed -i "s|<string name=\"displayName\" translatable=\"false\">Authenticator</string>|<string name=\"displayName\" translatable=\"false\">Authenticator ($REF)</string>|g" AuthenticatorPro.Droid/Resources/values/strings.xml
dotnet publish -f:$FRAMEWORK -c:$CONFIGURATION --no-restore AuthenticatorPro.Droid/AuthenticatorPro.Droid.csproj
APK=$(find AuthenticatorPro.Droid/bin/$CONFIGURATION/$FRAMEWORK/publish -name '*-Signed.apk')
mv $APK "me.jmh.authenticatorpro.$REF.apk"
- name: Publish Wear OS
run: |
REF=$(echo $GITHUB_SHA | cut -c -7)
sed -i "s|package=\"me.jmh.authenticatorpro\"|package=\"me.jmh.authenticatorpro.$REF\"|g" AuthenticatorPro.WearOS/Properties/AndroidManifest.xml
sed -i "s|<string name=\"displayName\" translatable=\"false\">Authenticator</string>|<string name=\"displayName\" translatable=\"false\">Authenticator ($REF)</string>|g" AuthenticatorPro.WearOS/Resources/values/strings.xml
dotnet publish -f:$FRAMEWORK -c:$CONFIGURATION --no-restore AuthenticatorPro.WearOS/AuthenticatorPro.WearOS.csproj
APK=$(find AuthenticatorPro.WearOS/bin/$CONFIGURATION/$FRAMEWORK/publish -name '*-Signed.apk')
mv $APK "me.jmh.authenticatorpro.wearos.$REF.apk"
- name: Generate coverage report
uses: irongut/[email protected]
with:
filename: coverage/**/coverage.cobertura.xml
badge: true
format: markdown
output: both
thresholds: '60 80'
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: AuthenticatorPro
path: |
me.jmh.authenticatorpro*.apk
code-coverage-results.md