Skip to content
This repository has been archived by the owner on Jun 28, 2023. It is now read-only.

Commit

Permalink
Revert to earlier CI, but fix issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Mortein committed Mar 1, 2021
1 parent 534595b commit e82d8ca
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 62 deletions.
73 changes: 11 additions & 62 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,95 +1,44 @@
name: CI

on: [push, pull_request]
on: [push]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up JDK
uses: actions/setup-java@v1
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: 1.8

- name: Set up Flutter
uses: subosito/flutter-action@v1
- uses: subosito/flutter-action@v1
with:
flutter-version: "1.22.x"
channel: "stable"

- name: Check formatting
run: flutter format --dry-run --set-exit-if-changed lib

- name: Analyze
run: flutter analyze --pub

- name: Unit testing
run: flutter test

- name: Build APK with Flutter
run: flutter build apk --pub --profile --flavor dev --no-shrink

- name: Save APK
uses: actions/upload-artifact@v1
with:
name: photoprism-apk
path: build/app/outputs/apk/dev/profile/

package:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'

steps:
- uses: actions/checkout@v2

- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 1.8

- name: Set up Flutter
uses: subosito/flutter-action@v1
with:
flutter-version: "1.22.x"
channel: "stable"

- name: Unit testing (with coverage)
run: flutter test --coverage

- name: Coverage
uses: codecov/codecov-action@v1
- run: flutter format --dry-run --set-exit-if-changed lib
- run: flutter analyze --pub
- run: flutter test --coverage
- uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage/lcov.info

- name: Build APK with Flutter
env:
- env:
KEY_JKS: ${{ secrets.KEY_JKS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
run: echo "$KEY_JKS" | base64 -d > key.jks && flutter build apk --pub --flavor prod --no-shrink

- name: Save APK
uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v1
with:
name: photoprism-apk
path: build/app/outputs/apk/prod/release/

release:
needs: package
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'

steps:
- uses: actions/download-artifact@v1
with:
name: photoprism-apk

- run: mv photoprism-apk/app-prod-release.apk photoprism.apk

- uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Pull Request CI

on: [pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: 1.8
- uses: subosito/flutter-action@v1
with:
flutter-version: "1.22.x"
channel: "stable"
- run: flutter format --dry-run --set-exit-if-changed lib
- run: flutter analyze --pub
- run: flutter test --coverage
- run: flutter build apk --pub --profile --flavor dev --no-shrink
- uses: actions/upload-artifact@v1
with:
name: photoprism-apk
path: build/app/outputs/apk/dev/profile/

0 comments on commit e82d8ca

Please sign in to comment.