ente/auth/.github/workflows/ci.yml

87 lines
3.4 KiB
YAML
Raw Normal View History

2023-09-02 04:28:42 +00:00
name: release
# This workflow is triggered on pushes to the repository.
on:
2023-01-28 08:07:00 +00:00
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
jobs:
2023-01-28 08:07:00 +00:00
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"
2023-01-28 08:07:00 +00:00
# Setup the flutter environment.
- uses: subosito/flutter-action@v2
with:
channel: "stable"
2023-09-28 15:23:52 +00:00
flutter-version: "3.13.4"
2023-01-28 08:07:00 +00:00
# Fetch sub modules
- run: git submodule update --init --recursive
2023-01-28 08:07:00 +00:00
# Get flutter dependencies.
- run: flutter pub get
2023-01-28 08:07:00 +00:00
- name: Setup keys
uses: timheuer/base64-to-file@v1
with:
fileName: "keystore/ente_auth_key.jks"
encodedString: ${{ secrets.SIGNING_KEY }}
2023-01-28 08:07:00 +00:00
# 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
2023-01-28 08:07:00 +00:00
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 }}
2023-01-28 08:16:51 +00:00
# Build Play store aab.
- name: Build
run: flutter build appbundle --release --flavor playstore --dart-define=app.flavor=playstore
2023-01-28 08:16:51 +00:00
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 }}
2023-01-28 08:07:00 +00:00
- name: Checksum
run: sha256sum build/app/outputs/flutter-apk/ente-auth.apk > build/app/outputs/flutter-apk/sha256sum
2023-01-28 08:07:00 +00:00
# Upload generated apk to the artifacts.
- uses: actions/upload-artifact@v2
with:
name: release-apk
path: build/app/outputs/flutter-apk/ente-auth.apk
2023-01-28 08:07:00 +00:00
- uses: actions/upload-artifact@v2
with:
name: release-checksum
path: build/app/outputs/flutter-apk/sha256sum
2023-01-28 08:07:00 +00:00
# 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 }}
2023-01-28 08:07:00 +00:00
# Upload to Play store
2023-01-28 08:31:10 +00:00
- uses: ente-io/upload-google-play@v1
2023-01-28 08:07:00 +00:00
with:
2023-01-28 08:16:51 +00:00
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
2023-01-28 08:07:00 +00:00
packageName: io.ente.auth
releaseFiles: build/app/outputs/bundle/playstoreRelease/app-playstore-release.aab
2023-01-28 08:07:00 +00:00
track: internal