Setup GitHub Actions and fastlane (#174)

This commit is contained in:
Tommy Chow 2022-08-04 23:47:08 -04:00 • committed by GitHub
parent 128c41e54a
commit d2c57921b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
35 changed files with 317 additions and 69 deletions

18
.github/release.yml vendored Normal file
View file

@ -0,0 +1,18 @@
# Used for auto-generating release notes.
changelog:
exclude:
labels:
- misc
categories:
- title: New Features
labels:
- new feature
- title: Improvements
labels:
- improvement
- title: Bug Fixes
labels:
- bug fix
- title: Other Changes
labels:
- "*"

64
.github/workflows/gh-release.yml vendored Normal file
View file

@ -0,0 +1,64 @@
# Drafts a GitHub release with the APK attached.
name: Draft GitHub release
on:
workflow_dispatch:
push:
tags:
- v*.*.*
jobs:
android:
name: Draft release and attach APK
runs-on: ubuntu-latest
env:
UPLOAD_KEYSTORE: ${{ secrets.UPLOAD_KEYSTORE }}
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
KEY_FILE_PATH: android/key.properties
CLIENT_ID: ${{ secrets.CLIENT_ID }}
SECRET: ${{ secrets.SECRET }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
steps:
- name: Checkout Frosty repo
uses: actions/checkout@v3
# Setup Java so that we can build the APK.
- name: Set up Java
uses: actions/setup-java@v2
with:
distribution: zulu
java-version: 11
# Setup and cache Flutter to install packages and build.
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
cache: true
# Decode and create the upload-keystore.jks file, used for signing the app.
- name: Decode and create upload-keystore.jks
run: echo $UPLOAD_KEYSTORE | base64 --decode > android/upload-keystore.jks
# Create the key.properties file, used for signing the app.
- name: Create key.properties
run: |
echo storePassword=$STORE_PASSWORD >> $KEY_FILE_PATH
echo keyPassword=$KEY_PASSWORD >> $KEY_FILE_PATH
echo keyAlias=upload >> $KEY_FILE_PATH
echo storeFile=upload-keystore.jks >> $KEY_FILE_PATH
# Build the APK with the environment variables and move/rename it.
- name: Build for Android
run: |
flutter build apk --dart-define CLIENT_ID=$CLIENT_ID --dart-define SECRET=$SECRET --dart-define SENTRY_DSN=$SENTRY_DSN
mv build/app/outputs/flutter-apk/app-release.apk frosty-${{ github.ref_name }}.apk
# Create a draft release on GitHub.
- name: Release
uses: softprops/action-gh-release@v1
with:
draft: true
generate_release_notes: true
files: frosty-${{ github.ref_name }}.apk

View file

@ -1,46 +0,0 @@
name: Release
# For now, have the option to run manually just to test things.
on: [workflow_dispatch]
jobs:
deploy:
name: Release/deploy the app for iOS and Android
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Setup Flutter
uses: subosito/flutter-action@v2
- name: Futter pre-checks and install packages
run: |
flutter doctor -v
flutter pub get
flutter analyze
- name: Build for iOS and Android
env:
CLIENT_ID: ${{ secrets.CLIENT_ID }}
SECRET: ${{ secrets.SECRET }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
UPLOAD_KEYSTORE: ${{ secrets.UPLOAD_KEYSTORE }}
run: |
echo "$UPLOAD_KEYSTORE" | base64 --decode > /android/key.properties
flutter build appbundle --dart-define CLIENT_ID=$CLIENT_ID --dart-define SECRET=$SECRET --dart-define SENTRY_DSN=$SENTRY_DSN
- name: Install bundler
run: gem install bundler
- name: Install fastlane Android dependencies with bundler
run: |
cd android
bundle install
- name: Run fastlane for Android
env:
PLAY_STORE_CREDENTIALS: ${{ secrets.PLAY_STORE_CREDENTIALS }}
run: |
cd android
fastlane deploy

103
.github/workflows/store-release.yml vendored Normal file
View file

@ -0,0 +1,103 @@
# Builds and releases frosty on the Google Play Store and Apple App Store through fastlane.
name: Build and release Frosty
on:
# Enable the option to manually run the workflow in the Actions tab.
workflow_dispatch:
# Only run if a semver tag was pushed.
push:
tags:
- v*.*.*
# Setup environment variables for use in all jobs.
env:
# Gemfile path used for caching dependencies.
BUNDLE_GEMFILE: ${{ github.workspace }}/android/Gemfile
CLIENT_ID: ${{ secrets.CLIENT_ID }}
SECRET: ${{ secrets.SECRET }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
jobs:
android:
name: Build and release Frosty on Android
runs-on: ubuntu-latest
env:
UPLOAD_KEYSTORE: ${{ secrets.UPLOAD_KEYSTORE }}
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
KEY_FILE_PATH: android/key.properties
PLAY_STORE_CREDENTIALS: ${{ secrets.PLAY_STORE_CREDENTIALS }}
steps:
- name: Checkout Frosty repo
uses: actions/checkout@v3
# Install Ruby and install/cache dependencies with bundler in order to use fastlane.
- name: Set up Ruby and Bundler
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
bundler-cache: true
# Setup Java so that we can build the appbundle.
- name: Set up Java
uses: actions/setup-java@v2
with:
distribution: zulu
java-version: 11
# Setup and cache Flutter to install packages and build.
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
cache: true
# Decode and create the upload-keystore.jks file, used for signing the app.
- name: Decode and create upload-keystore.jks
run: echo $UPLOAD_KEYSTORE | base64 --decode > $GITHUB_WORKSPACE/android/upload-keystore.jks
# Create the key.properties file, used for signing the app.
- name: Create key.properties
run: |
echo storePassword=$STORE_PASSWORD >> $KEY_FILE_PATH
echo keyPassword=$KEY_PASSWORD >> $KEY_FILE_PATH
echo keyAlias=upload >> $KEY_FILE_PATH
echo storeFile=$GITHUB_WORKSPACE/android/upload-keystore.jks >> $KEY_FILE_PATH
# Build the Android app bundle (AAB) and pass the environment variables.
- name: Build the Android AAB
run: flutter build appbundle --dart-define CLIENT_ID=$CLIENT_ID --dart-define SECRET=$SECRET --dart-define SENTRY_DSN=$SENTRY_DSN
# Deploy to the play store with fastlane.
- name: Deploy with fastlane
run: cd android && bundle exec fastlane deploy
ios:
name: Build and release Frosty on iOS
runs-on: macos-latest
env:
APP_STORE_KEY_ID: ${{ secrets.APP_STORE_KEY_ID }}
APP_STORE_ISSUER_ID: ${{ secrets.APP_STORE_ISSUER_ID }}
APP_STORE_CREDENTIALS: ${{ secrets.APP_STORE_CREDENTIALS }}
MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
steps:
- name: Checkout Frosty repo
uses: actions/checkout@v3
# Install Ruby and install/cache dependencies with bundler in order to use fastlane.
- name: Set up Ruby and Bundler
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
bundler-cache: true
# Setup and cache Flutter to install packages and build.
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
cache: true
# Setup the iOS project with environment variables without signing (building and signing will happen in fastlane).
- name: Config the iOS build
run: flutter build ios --no-codesign --config-only --dart-define CLIENT_ID=$CLIENT_ID --dart-define SECRET=$SECRET --dart-define SENTRY_DSN=$SENTRY_DSN
# Sign, build the app, and deploy to app store with fastlane.
- name: Sign, build, and release with fastlane
run: cd ios && bundle exec fastlane release

6
.gitignore vendored
View file

@ -57,6 +57,10 @@ random/
# snapshot generated screenshots # snapshot generated screenshots
**/fastlane/screenshots **/fastlane/screenshots
**/fastlane/metadata/android/en-US/images
# scan temporary files # scan temporary files
**/fastlane/test_output **/fastlane/test_output
# potentially sensitive review information
**/fastlane/metadata/review_information

View file

@ -210,6 +210,9 @@ GEM
PLATFORMS PLATFORMS
arm64-darwin-21 arm64-darwin-21
x86_64-darwin-19
x86_64-linux
x64-mingw-ucrt
DEPENDENCIES DEPENDENCIES
fastlane fastlane

View file

@ -18,10 +18,8 @@ default_platform(:android)
platform :android do platform :android do
desc "Deploy a new version to the Google Play" desc "Deploy a new version to the Google Play"
lane :deploy do lane :deploy do
# Upload to the play store ussing the provided credentials and AAB from flutter build.
upload_to_play_store( upload_to_play_store(
validate_only: true,
skip_upload_images: true,
skip_upload_screenshots: true,
json_key_data: Base64.decode64(ENV["PLAY_STORE_CREDENTIALS"]), json_key_data: Base64.decode64(ENV["PLAY_STORE_CREDENTIALS"]),
aab: "../build/app/outputs/bundle/release/app-release.aab" aab: "../build/app/outputs/bundle/release/app-release.aab"
) )

View file

@ -0,0 +1,4 @@
Version 2.1.1
Bug Fixes
• Fixed old data restoring on reinstall

View file

@ -0,0 +1,19 @@
Frosty is a free and open-source mobile app for Twitch built from the ground up. It supports emotes and badges from BetterTTV (BTTV), FrankerFaceZ (FFZ), and 7TV — popular third-party extensions for Twitch used by millions.
Features:
• Support for BetterTTV, FrankerFaceZ, and 7TV emotes and badges
• Browse followed streams, top streams, and top categories
• Autocomplete for emotes and user mentions
• Light, dark, and black (OLED) themes
• Search for channels and categories
• See and filter chatters in a channel
• Local chat user message history
• Theater and fullscreen mode
• Watch live streams with chat
• Picture-in-picture mode
• Block and report users
• Emote menu
• Sleep timer
• And more...
For more details, check out the full source on GitHub: https://github.com/tommyxchow/frosty

View file

@ -0,0 +1 @@
A mobile Twitch app with BetterTTV (BTTV), FrankerFaceZ (FFZ), and 7TV support.

View file

@ -0,0 +1 @@
Frosty for Twitch

View file

@ -210,6 +210,7 @@ GEM
PLATFORMS PLATFORMS
arm64-darwin-21 arm64-darwin-21
x86_64-darwin-19
DEPENDENCIES DEPENDENCIES
fastlane fastlane

View file

@ -354,6 +354,7 @@
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 7W46KBTB6P; DEVELOPMENT_TEAM = 7W46KBTB6P;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
@ -364,6 +365,7 @@
); );
PRODUCT_BUNDLE_IDENTIFIER = com.tommychow.frosty; PRODUCT_BUNDLE_IDENTIFIER = com.tommychow.frosty;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "match AppStore com.tommychow.frosty";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic"; VERSIONING_SYSTEM = "apple-generic";
@ -483,6 +485,7 @@
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 7W46KBTB6P; DEVELOPMENT_TEAM = 7W46KBTB6P;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
@ -493,6 +496,7 @@
); );
PRODUCT_BUNDLE_IDENTIFIER = com.tommychow.frosty; PRODUCT_BUNDLE_IDENTIFIER = com.tommychow.frosty;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "match AppStore com.tommychow.frosty";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
@ -506,6 +510,8 @@
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 7W46KBTB6P; DEVELOPMENT_TEAM = 7W46KBTB6P;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
@ -516,6 +522,7 @@
); );
PRODUCT_BUNDLE_IDENTIFIER = com.tommychow.frosty; PRODUCT_BUNDLE_IDENTIFIER = com.tommychow.frosty;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "match AppStore com.tommychow.frosty";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic"; VERSIONING_SYSTEM = "apple-generic";

3
ios/fastlane/Deliverfile Normal file
View file

@ -0,0 +1,3 @@
# The Deliverfile allows you to store various App Store Connect metadata
# For more information, check out the docs
# https://docs.fastlane.tools/actions/deliver/

View file

@ -16,32 +16,32 @@
default_platform(:ios) default_platform(:ios)
platform :ios do platform :ios do
desc "Push a new release build to the App Store" desc 'Push a new release build to the App Store'
lane :release do lane :release do
build_app(workspace: "Runner.xcworkspace", scheme: "Runner") # Setup for CI. Uses a keychain to prevent the CI from hanging due to password prompts.
upload_to_app_store setup_ci
end
desc "Upload a new build to TestFlight"
lane :testflight do
# Signing and certificate information
match(type: "appstore")
# Obtain credentials from App Store Connect API. Will be automatically used for the rest of the lane.
app_store_connect_api_key( app_store_connect_api_key(
key_id: ENV["APP_STORE_KEY_ID"], key_id: ENV['APP_STORE_KEY_ID'],
issuer_id: ENV["APP_STORE_ISSUER_ID"], issuer_id: ENV['APP_STORE_ISSUER_ID'],
key_content: ENV["APP_STORE_CREDENTIALS"], key_content: ENV['APP_STORE_CREDENTIALS'],
is_key_content_base64: true, is_key_content_base64: true,
) )
# gym, AKA the build action # Manage code signing (with match).
gym( sync_code_signing
skip_build_archive: true,
archive_path: "../build/ios/archive/Runner.xcarchive", # Build the app for release.
build_app(
workspace: 'Runner.xcworkspace',
scheme: 'Runner',
output_directory: '../build/ios/archive'
) )
upload_to_testflight( # Upload the app to the App Store.
skip_submission: true, upload_to_app_store(
submit_for_review: true,
) )
end end
end end

32
ios/fastlane/README.md Normal file
View file

@ -0,0 +1,32 @@
fastlane documentation
----
# Installation
Make sure you have the latest version of the Xcode command line tools installed:
```sh
xcode-select --install
```
For _fastlane_ installation instructions, see [Installing _fastlane_](https://docs.fastlane.tools/#installing-fastlane)
# Available Actions
## iOS
### ios release
```sh
[bundle exec] fastlane ios release
```
Push a new release build to the App Store
----
This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run.
More information about _fastlane_ can be found on [fastlane.tools](https://fastlane.tools).
The documentation of _fastlane_ can be found on [docs.fastlane.tools](https://docs.fastlane.tools).

View file

@ -0,0 +1 @@
2022 Tommy Chow

View file

@ -0,0 +1 @@

View file

@ -0,0 +1,19 @@
Frosty is a free and open-source mobile app for Twitch built from the ground up. It supports emotes and badges from BetterTTV (BTTV), FrankerFaceZ (FFZ), and 7TV — popular third-party extensions for Twitch used by millions.
Features:
• Support for BetterTTV, FrankerFaceZ, and 7TV emotes and badges
• Browse followed streams, top streams, and top categories
• Autocomplete for emotes and user mentions
• Light, dark, and black (OLED) themes
• Search for channels and categories
• See and filter chatters in a channel
• Local chat user message history
• Theater and fullscreen mode
• Watch live streams with chat
• Picture-in-picture mode
• Block and report users
• Emote menu
• Sleep timer
• And more...
For more information, check out the full source on GitHub: https://github.com/tommyxchow/frosty

View file

@ -0,0 +1 @@
twitch,bttv,ffz,7tv,betterttv,frankerfacez,seventv,emote,stream,chat,xqc,forsen,flutter,twitchtv,lol

View file

@ -0,0 +1 @@
https://www.frostyapp.io/

View file

@ -0,0 +1 @@
Frosty for Twitch

View file

@ -0,0 +1 @@
https://www.privacypolicies.com/live/095b4264-31b1-4280-837e-5843abde8b16

View file

@ -0,0 +1 @@
A free and open-source mobile app for Twitch with BetterTTV (BTTV), FrankerFaceZ (FFZ), and 7TV support.

View file

@ -0,0 +1,2 @@
Bug Fixes
• Fixed picture-in-picture not dismissing when going back

View file

@ -0,0 +1 @@
See BTTV, FFZ, and 7TV emotes!

View file

@ -0,0 +1 @@
https://github.com/tommyxchow/frosty

View file

@ -0,0 +1 @@
ENTERTAINMENT

View file

@ -0,0 +1 @@

View file

@ -0,0 +1 @@

View file

@ -0,0 +1 @@
PHOTO_AND_VIDEO

View file

@ -0,0 +1 @@

View file

@ -0,0 +1 @@