ente/.github/workflows/release.yml

71 lines
2.2 KiB
YAML
Raw Normal View History

2021-07-31 06:24:19 +00:00
name: Flutter CI
# This workflow is triggered on pushes to the repository.
on:
2021-07-31 06:31:23 +00:00
workflow_dispatch:
# Enable manual run
2021-07-31 06:24:19 +00:00
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v4.2.0
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.
2021-07-31 07:21:19 +00:00
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
2021-07-31 06:24:19 +00:00
with:
2021-07-31 07:26:09 +00:00
distribution: 'adopt'
2021-07-31 07:21:19 +00:00
java-version: '11'
2021-07-31 06:24:19 +00:00
# Setup the flutter environment.
- uses: subosito/flutter-action@v1
with:
channel: 'stable'
flutter-version: '3.3.0'
2021-07-31 06:24:19 +00:00
2021-07-31 06:30:42 +00:00
# Fetch sub modules
- run: git submodule update --init --recursive
2021-07-31 06:24:19 +00:00
# Get flutter dependencies.
- run: flutter pub get
2021-07-31 13:12:51 +00:00
- name: Setup keys
2021-07-31 10:55:32 +00:00
uses: timheuer/base64-to-file@v1
with:
2021-07-31 13:12:51 +00:00
fileName: 'keystore/ente_photos_key.jks'
2021-07-31 11:57:23 +00:00
encodedString: ${{ secrets.SIGNING_KEY }}
2021-07-31 10:55:32 +00:00
2021-07-31 07:36:18 +00:00
# Build independent apk.
2021-07-31 13:12:51 +00:00
- name: Build
2021-10-07 15:42:35 +00:00
run: flutter build apk --release --flavor independent && mv build/app/outputs/flutter-apk/app-independent-release.apk build/app/outputs/flutter-apk/ente.apk
2021-07-31 10:55:32 +00:00
env:
2021-07-31 13:12:51 +00:00
SIGNING_KEY_PATH: '/home/runner/work/_temp/keystore/ente_photos_key.jks'
2021-07-31 11:54:52 +00:00
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
2021-07-31 06:24:19 +00:00
2022-10-03 14:01:43 +00:00
- name: Checksum
run: sha256sum build/app/outputs/flutter-apk/ente.apk > build/app/outputs/flutter-apk/checksum
2021-07-31 06:24:19 +00:00
# Upload generated apk to the artifacts.
2021-07-31 10:55:32 +00:00
- uses: actions/upload-artifact@v2
2021-07-31 06:24:19 +00:00
with:
name: release-apk
2021-10-07 15:42:35 +00:00
path: build/app/outputs/flutter-apk/ente.apk
- uses: actions/upload-artifact@v2
with:
2022-10-03 14:01:43 +00:00
name: release-checksum
path: build/app/outputs/flutter-apk/checksum
# Create a Github release
- uses: ncipollo/release-action@v1
with:
artifacts: "build/app/outputs/flutter-apk/ente.apk,build/app/outputs/flutter-apk/checksum"
token: ${{ secrets.GITHUB_TOKEN }}