Skip to content

Commit

Permalink
update pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
fremartini committed Oct 15, 2023
1 parent 5f327ac commit cceb842
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 166 deletions.
8 changes: 4 additions & 4 deletions .github/actions/build_android/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ runs:

- name: Build apk (dev)
if: ${{ inputs.prod_release }} != 'true'
run: flutter build apk --flavor development --release --build-name ${{ needs.version.outputs.version }} --build-number ${{ needs.version.outputs.build_version }} --target lib/main_development.dart
run: flutter build apk --flavor development --release --build-name ${{ inputs.version }} --build-number ${{ inputs.build_version }} --target lib/main_development.dart
shell: bash

- name: Build appbundle (prod)
if: ${{ inputs.prod_release }} == 'true'
run: flutter build apk --flavor production --release --dart-define=IS_PROD=true --build-name ${{ needs.version.outputs.version }} --build-number ${{ needs.version.outputs.build_version }} --target lib/main_production.dart
run: flutter build apk --flavor production --release --dart-define=IS_PROD=true --build-name ${{ inputs.version }} --build-number ${{ inputs.build_version }} --target lib/main_production.dart
shell: bash

- name: Upload Android build (dev)
if: ${{ !!inputs.store_artifacts && ${{ inputs.prod_release }} != 'true' }}
if: ${{ !!inputs.store_artifacts && inputs.prod_release != 'true' }}
uses: actions/[email protected]
with:
name: android
Expand All @@ -49,7 +49,7 @@ runs:
if-no-files-found: error

- name: Upload Android build (prod)
if: ${{ !!inputs.store_artifacts && ${{ inputs.prod_release }} == 'true' }}
if: ${{ !!inputs.store_artifacts && inputs.prod_release == 'true' }}
uses: actions/[email protected]
with:
name: android
Expand Down
19 changes: 8 additions & 11 deletions .github/actions/build_ios/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ runs:
steps:
- name: Install Apple certificate and provisioning profile (dev)
if: ${{ inputs.prod_release }} != 'true'
run: .github/scripts/setup-certs.command
run: .github/scripts/setup-certs.sh
env:
APPLE_IOS_SIGNING_CERT: ${{ inputs.apple_ios_signing_cert_dev }}
APPLE_IOS_SIGNING_CERT_PW: ${{ inputs.apple_ios_signing_cert_pw_dev }}
Expand All @@ -49,21 +49,18 @@ runs:
shell: bash

- name: Install Apple certificate and provisioning profile (prod)
if: ${{ inputs.prod_release }}== 'true'
run: .github/scripts/setup-certs.command
if: ${{ inputs.prod_release }} == 'true'
run: .github/scripts/setup-certs.sh
env:
APPLE_IOS_SIGNING_CERT: ${{ inputs.apple_ios_signing_cert_prod }}
APPLE_IOS_SIGNING_CERT_PW: ${{ inputs.apple_ios_signing_cert_pw_prod }}
APPLE_IOS_PROVISIONING_PROFILE: ${{ inputs.apple_ios_provisioning_profile_prod }}
APPLE_KEYCHAIN_PW: ${{ inputs.apple_keychain_pw }}
shell: bash

- name: Setup Flutter environment
uses: ./.github/actions/setup_flutter_environment

- name: Set URI (prod)
if: github.ref_name == 'production'
run: sed -i '' 's/.env.develop/.env.production/' lib/env/env.dart
- name: Replace target URI in Production
if: ${{ inputs.prod_release }} == 'true'
run: sed -i 's/.env.develop/.env.production/' lib/env/env.dart
shell: bash

- name: Generate code
Expand All @@ -72,12 +69,12 @@ runs:

- name: Build iOS (dev)
if: ${{ inputs.prod_release }} != 'true'
run: .github/scripts/build-dev.sh ${{ needs.version.outputs.version }} ${{ needs.version.outputs.build_version }}
run: .github/scripts/build-dev.sh ${{ inputs.version }} ${{ inputs.build_version }}
shell: bash

- name: Build iOS (prod)
if: ${{ inputs.prod_release }} == 'true'
run: .github/scripts/build-prod.sh ${{ needs.version.outputs.version }} ${{ needs.version.outputs.build_version }}
run: .github/scripts/build-prod.sh ${{ inputs.version }} ${{ inputs.build_version }}
shell: bash

- name: Upload iOS build
Expand Down
21 changes: 13 additions & 8 deletions .github/actions/setup_flutter_environment/action.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
name: Setup Flutter environment
description: Setup the Flutter environment
inputs:
prod_release:
required: false
default: 'false'
description: "Is prod release"

env:
FLUTTER_VERSION: 3.13.7

runs:
using: "composite"
steps:
- name: Setup Flutter environment
uses: subosito/[email protected]
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: "stable"
- name: Setup Flutter environment
uses: subosito/[email protected]
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: "stable"

- name: Download dependencies
run: flutter pub get
shell: bash
- name: Download dependencies
run: flutter pub get
shell: bash
61 changes: 0 additions & 61 deletions .github/actions/upload_android/action.yml

This file was deleted.

40 changes: 0 additions & 40 deletions .github/actions/upload_ios/action.yml

This file was deleted.

23 changes: 0 additions & 23 deletions .github/actions/upload_to_firebase/action.yml

This file was deleted.

3 changes: 1 addition & 2 deletions .github/workflows/codesee.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
# This is v2.0 of this workflow file
on:
push:
branches:
- main
branches: [ main ]
pull_request_target:
types: [opened, synchronize, reopened]

Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ on:
branches: [ main ]

jobs:
build_and_test:
build:
uses: ./.github/workflows/build.yml
with:
store_artifacts: true
prod_release: false
secrets: inherit

dev_upload_ios:
upload_ios:
name: Upload iOS build to Firebase App Distribution
runs-on: ubuntu-latest
needs: [build_and_test]
needs: [build]

steps:
- name: Download Artifact
Expand All @@ -33,10 +33,10 @@ jobs:
groups: analogio-devs
file: Analog.ipa

dev_upload_android:
upload_android:
name: Upload Android build to Firebase App Distribution
runs-on: ubuntu-latest
needs: [build_and_test]
needs: [build]

steps:
- name: Download artifact
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/release-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ name: Release Production App

on:
release:
types: [created]
types: [ created ]

jobs:
build_and_test:
build:
uses: ./.github/workflows/build.yml
with:
store_artifacts: true
prod_release: true
tagName: ${{ github.event.release.tag_name }}
tag_name: ${{ github.event.release.tag_name }}
secrets: inherit

prod_release_ios:
release_ios:
name: Upload iOS build to App Store connect
runs-on: macos-latest
needs: [build_and_test]
needs: [build]

steps:
- name: Download artifact
Expand All @@ -31,10 +31,10 @@ jobs:
run: |
xcrun altool --upload-app -t ios -f "Analog.ipa" -u "$APP_STORE_CONNECT_USERNAME" -p "$APP_STORE_CONNECT_PASSWORD"
prod_release_android:
release_android:
name: Upload Android build to Play Store
runs-on: ubuntu-latest
needs: [build_and_test]
needs: [build]

steps:
- name: Download artifact
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,19 @@ name: Test

on:
pull_request:
branches: [production, develop]
branches: [main]

jobs:
build-and-test:
name: Build and test Flutter app
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2.4.0
uses: actions/checkout@v3

- name: Setup Flutter environment
uses: ./.github/actions/setup_flutter_environment

- name: Generate code
run: dart run build_runner build

- name: Check formatting
run: dart format --set-exit-if-changed lib/

Expand Down

0 comments on commit cceb842

Please sign in to comment.