Skip to content

Commit

Permalink
Test release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
BramDC3 committed Sep 10, 2024
1 parent 90cdfaa commit 3c3b95e
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 10 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/default-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: default-workflow
on: [push]
# TODO:
# on:
# push:
# branches:
# - main
on:
push:
branches:
- main
jobs:
test:
name: Run tests
Expand Down Expand Up @@ -90,6 +88,4 @@ jobs:

- name: Build debug
run: bundle exec fastlane ios build_debug

# - name: Decode and save FIREBASE_APP_DISTRIBUTION_SERVICE_ACCOUNT.json
# run: echo "${{ secrets.FIREBASE_APP_DISTRIBUTION_SERVICE_ACCOUNT_JSON }}" | base64 -d > ./FIREBASE_APP_DISTRIBUTION_SERVICE_ACCOUNT.json

102 changes: 102 additions & 0 deletions .github/workflows/release-workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: release-workflow
on: [push]
# TODO:
# on:
# push:
# branches:
# - release/*
jobs:
# test:
# name: Run tests
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4

# - name: Set up Ruby
# uses: ruby/setup-ruby@v1
# with:
# ruby-version: "3.1.1" # TODO: keep this somewhere where it's easy to change

# - name: Install gems
# run: bundle install

# - name: Install FVM
# run: curl -fsSL https://fvm.app/install.sh | bash

# - name: Set up FVM
# run: fvm use

# - name: Run virtual machine tests
# run: bundle exec fastlane run_vm_tests

build_android:
name: Build Android release
runs-on: ubuntu-latest
# needs: test
steps:
- uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.1.1" # TODO: keep this somewhere where it's easy to change

- name: Install gems
run: bundle install

- name: Install FVM
run: curl -fsSL https://fvm.app/install.sh | bash

- name: Set up FVM
run: fvm use

- name: Decode and save google-services.json
run: echo "${{ secrets.GOOGLE_SERVICES_JSON }}" | base64 -d > ./android/app/google-services.json

- name: Decode and save key.properties
run: echo "${{ secrets.ANDROID_KEY_PROPERTIES }}" | base64 -d > ./android/key.properties

- name: Decode and save keystore
run: echo "${{ secrets.COCKTAILR_UPLOAD_KEYSTORE_JKS }}" | base64 -d > ./android/app/cocktailr-upload-keystore.jks

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'

- name: Build release
run: bundle exec fastlane android build_release

- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: app-release-apk
path: ./build/app/outputs/flutter-apk/app-release.apk

distribute:
name: Distribute Android release
runs-on: ubuntu-latest
needs: build_android
steps:
- uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.1.1" # TODO: keep this somewhere where it's easy to change

- name: Install gems
run: bundle install

- name: Decode and save Firebase App Distribution service account
run: echo "${{ secrets.FIREBASE_APP_DISTRIBUTION_SERVICE_ACCOUNT_JSON }}" | base64 -d > ./FIREBASE_APP_DISTRIBUTION_SERVICE_ACCOUNT.json

- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: app-release-apk
path: ./build/app/outputs/flutter-apk

- name: Distribute release
run: bundle exec fastlane android distribute_firebase
2 changes: 1 addition & 1 deletion fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ platform :android do
lane :distribute_firebase do
Dir.chdir("..") do
android_artifact_path = File.expand_path("./build/app/outputs/flutter-apk/app-release.apk", Dir.pwd)
service_credentials_file = File.expand_path("./FIREBASE_APP_DISTRIBUTION_SERVICE_ACCOUNT_KEY.json", Dir.pwd)
service_credentials_file = File.expand_path("./FIREBASE_APP_DISTRIBUTION_SERVICE_ACCOUNT.json", Dir.pwd)

firebase_app_distribution(
app: "1:30086613147:android:9d5c7c6b5005dcdddb1e3e",
Expand Down

0 comments on commit 3c3b95e

Please sign in to comment.