<!-- Thanks for contributing! Provide a description of your changes below and a general summary in the title Please look at the following checklist to ensure that your PR can be accepted quickly: --> ## Description This is a PR that makes the auth build runnable on the Desktop platform. Below is a screenshot for the same:  Some things to note: - LocalAuth will be bypassed on unsupported platforms (desktop) - Switched to sodium and sodium-libs from flutter_sodium. - QR code library is incompatible with desktop, So I removed access to those pages. - Bumped some dependencies and done some lint fixes - Also add save key option as send file may not help on desktop (related #380) https://github.com/ente-io/auth/assets/41370460/3f3471e8-45f6-4146-88ac-b763d4f38b32 - Update Recovery Key Card UI  So this is a step towards more updated code and better multiplatform support. ## Type of Change <!--- Put an `x` in all the boxes that apply: --> - [ ] 🖼️ New icon - [x] ✨ New feature (non-breaking change which adds functionality) - [ ] 🛠️ Bug fix (non-breaking change which fixes an issue) - [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change) - [x] 🧹 Code refactor - [ ] ✅ Build configuration change - [ ] 📝 Documentation - [ ] 🗑️ Chore --------- Co-authored-by: Neeraj Gupta <254676+ua741@users.noreply.github.com>
90 lines
3.1 KiB
YAML
90 lines
3.1 KiB
YAML
name: release
|
|
|
|
# This workflow is triggered on pushes to the repository.
|
|
on:
|
|
workflow_dispatch:
|
|
# Enable manual run
|
|
push:
|
|
# Sequence of patterns matched against refs/tags
|
|
tags:
|
|
- "v*" # Push events to matching v*, i.e. v4.2.0
|
|
|
|
env:
|
|
FLUTTER_VERSION: "3.16.9"
|
|
|
|
jobs:
|
|
build:
|
|
# This job will run on ubuntu virtual machine
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
# Setup Java environment in order to build the Android app.
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-java@v2
|
|
with:
|
|
distribution: "adopt"
|
|
java-version: "11"
|
|
|
|
# Setup the flutter environment.
|
|
- uses: subosito/flutter-action@v2
|
|
with:
|
|
cache: true
|
|
flutter-version: ${{ env.FLUTTER_VERSION }}
|
|
|
|
# Fetch sub modules
|
|
- run: git submodule update --init --recursive
|
|
|
|
# Get flutter dependencies.
|
|
- run: flutter pub get
|
|
|
|
- name: Setup keys
|
|
uses: timheuer/base64-to-file@v1
|
|
with:
|
|
fileName: "keystore/ente_auth_key.jks"
|
|
encodedString: ${{ secrets.SIGNING_KEY }}
|
|
|
|
# Build independent apk.
|
|
- name: Build
|
|
run: flutter build apk --release --flavor independent --dart-define=app.flavor=independent && mv build/app/outputs/flutter-apk/app-independent-release.apk build/app/outputs/flutter-apk/ente-auth.apk
|
|
env:
|
|
SIGNING_KEY_PATH: "/home/runner/work/_temp/keystore/ente_auth_key.jks"
|
|
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
|
|
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
|
|
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
|
|
|
|
# Build Play store aab.
|
|
- name: Build
|
|
run: flutter build appbundle --release --flavor playstore --dart-define=app.flavor=playstore
|
|
env:
|
|
SIGNING_KEY_PATH: "/home/runner/work/_temp/keystore/ente_auth_key.jks"
|
|
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
|
|
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
|
|
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
|
|
|
|
- name: Checksum
|
|
run: sha256sum build/app/outputs/flutter-apk/ente-auth.apk > build/app/outputs/flutter-apk/sha256sum
|
|
|
|
# Upload generated apk to the artifacts.
|
|
- uses: actions/upload-artifact@v2
|
|
with:
|
|
name: release-apk
|
|
path: build/app/outputs/flutter-apk/ente-auth.apk
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
with:
|
|
name: release-checksum
|
|
path: build/app/outputs/flutter-apk/sha256sum
|
|
|
|
# Create a Github release
|
|
- uses: ncipollo/release-action@v1
|
|
with:
|
|
artifacts: "build/app/outputs/flutter-apk/ente-auth.apk,build/app/outputs/flutter-apk/sha256sum"
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
# Upload to Play store
|
|
- uses: ente-io/upload-google-play@v1
|
|
with:
|
|
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
|
|
packageName: io.ente.auth
|
|
releaseFiles: build/app/outputs/bundle/playstoreRelease/app-playstore-release.aab
|
|
track: internal
|