This repository has been archived by the owner on Jun 23, 2024. It is now read-only.
Removed deprecated enableDithering #50
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "[DEV] Build and Publish" | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
develop | |
env: | |
JAVA_VERSION: "12.x" | |
FLUTTER_CHANNEL: "stable" | |
#PROPERTIES_PATH: "./android/key.properties" | |
jobs: | |
build_ios: | |
name: "Build IOS" | |
runs-on: macos-latest | |
steps: | |
- uses: actions/[email protected] | |
- uses: actions/[email protected] | |
with: | |
distribution: 'zulu' | |
java-version: ${{env.JAVA_VERSION}} | |
cache: "gradle" | |
# Gradle cache for faster builds | |
- uses: actions/[email protected] | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
# Setup the flutter environment. | |
- uses: subosito/[email protected] | |
with: | |
channel: ${{env.FLUTTER_CHANNEL}} | |
cache: true | |
#- run: | | |
# echo storePassword=${{ secrets.STORE_PASSWORD }} >> ${{env.PROPERTIES_PATH}} | |
# echo keyPassword=${{ secrets.KEY_PASSWORD }} >> ${{env.PROPERTIES_PATH}} | |
# echo keyAlias=${{ secrets.KEY_ALIAS }} >> ${{env.PROPERTIES_PATH}} | |
# echo storeFile=/home/runner/work/Soundal/Soundal/android/app/keystore.jks >> ${{env.PROPERTIES_PATH}} | |
# echo ${{ secrets.KEYSTORE }} | base64 --decode > /home/runner/work/Soundal/Soundal/android/app/keystore.jks | |
# Get flutter dependencies. | |
- run: flutter pub get | |
# Check for any formatting issues in the code. | |
#- run: dart format --set-exit-if-changed . | |
# Statically analyze the Dart code for any errors. | |
- run: flutter analyze . --no-fatal-infos --no-fatal-warnings | |
# Run widget tests for our flutter project. | |
- run: flutter test | |
# Build app. | |
- run: flutter build ios --release --no-codesign --build-number=${{ github.run_number }} | |
- name: Create IPA | |
run: | | |
cd build/ios/iphoneos/ | |
mkdir Payload | |
mv Runner.app Payload/ | |
zip -r Soundal_beta.ipa Payload | |
# Upload generated apk to the artifacts. | |
- uses: actions/[email protected] | |
with: | |
name: Soundal_beta.ipa | |
path: build/ios/iphoneos/Soundal_beta.ipa | |
build_android: | |
name: "Build Android" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
# Setup Java environment in order to build the Android app. | |
- uses: actions/[email protected] | |
with: | |
distribution: 'zulu' | |
java-version: ${{env.JAVA_VERSION}} | |
cache: "gradle" | |
# Gradle cache for faster builds | |
- uses: actions/[email protected] | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
# Setup the flutter environment. | |
- uses: subosito/[email protected] | |
with: | |
channel: ${{env.FLUTTER_CHANNEL}} | |
cache: true | |
#- run: | | |
# echo storePassword=${{ secrets.STORE_PASSWORD }} >> ${{env.PROPERTIES_PATH}} | |
# echo keyPassword=${{ secrets.KEY_PASSWORD }} >> ${{env.PROPERTIES_PATH}} | |
# echo keyAlias=${{ secrets.KEY_ALIAS }} >> ${{env.PROPERTIES_PATH}} | |
# echo storeFile=/home/runner/work/Soundal/Soundal/android/app/keystore.jks >> ${{env.PROPERTIES_PATH}} | |
# echo ${{ secrets.KEYSTORE }} | base64 --decode > /home/runner/work/Soundal/Soundal/android/app/keystore.jks | |
# Get flutter dependencies. | |
- run: flutter pub get | |
# Check for any formatting issues in the code. | |
#- run: dart format --set-exit-if-changed . | |
# Statically analyze the Dart code for any errors. | |
- run: flutter analyze . --no-fatal-infos --no-fatal-warnings | |
# Run widget tests for our flutter project. | |
- run: flutter test | |
# Build apk. | |
- run: flutter build apk --release --build-number=${{ github.run_number }} | |
- name: Rename file | |
run: mv build/app/outputs/apk/release/app-release.apk build/app/outputs/apk/release/Soundal_beta.apk | |
# Upload generated apk to the artifacts. | |
- uses: actions/[email protected] | |
with: | |
name: Soundal_beta.apk | |
path: build/app/outputs/apk/release/Soundal_beta.apk | |
release: | |
name: "Publish" | |
runs-on: ubuntu-latest | |
needs: [build_android, build_ios] | |
steps: | |
- uses: actions/[email protected] | |
- uses: actions/[email protected] | |
with: | |
path: artifacts | |
- name: Get version | |
id: yq | |
uses: mikefarah/yq@master | |
with: | |
cmd: yq -r '.version' 'pubspec.yaml' | |
- uses: bhowell2/[email protected] | |
id: version | |
with: | |
value: ${{ steps.yq.outputs.result }} | |
length_from_start: 5 | |
- uses: "marvinpinto/action-automatic-releases@latest" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: "Soundal-v${{ steps.version.outputs.substring }}-beta${{ github.run_number }}" | |
prerelease: true | |
title: "Soundal-v${{ steps.version.outputs.substring }}-beta${{ github.run_number }}" | |
files: | | |
LICENSE | |
./artifacts/Soundal_beta.apk | |
./artifacts/Soundal_beta.ipa | |
#- uses: actions/upload-artifact@v2 | |
# with: | |
# name: app-armeabi-v7a-release.apk | |
# path: build/app/outputs/apk/release/app-armeabi-v7a-release.apk | |
# - name: Commit on Telegram | |
# uses: appleboy/telegram-action@master | |
# with: | |
# to: ${{ secrets.TELEGRAM_CHAT_ID }} | |
# token: ${{ secrets.TELEGRAM_BOT_TOKEN }} | |
# format: markdown | |
# disable_web_page_preview: true | |
# message: | | |
# New commit pushed to [${{ github.event.repository.name }}](${{ github.event.repository.html_url }}) by [${{ github.event.head_commit.author.name }}](${{ github.event.head_commit.author.html_url }}). | |
# Commit message: ${{ github.event.head_commit.message }} | |
# document: build/app/outputs/apk/release/app-arm64-v8a-release.apk, build/app/outputs/apk/release/app-armeabi-v7a-release.apk | |
# - name: Report failure on Telegram | |
# uses: appleboy/telegram-action@master | |
# if: ${{ failure() }} | |
# with: | |
# to: ${{ secrets.TELEGRAM_CHAT_ID }} | |
# token: ${{ secrets.TELEGRAM_BOT_TOKEN }} | |
# format: markdown | |
# disable_web_page_preview: true | |
# message: | | |
# Build Failed!! @Sangwan5688 | |
# Commit was pushed to [${{ github.event.repository.name }}](${{ github.event.repository.html_url }}) by [${{ github.event.head_commit.author.name }}](${{ github.event.head_commit.author.html_url }}). | |
# Commit message: ${{ github.event.head_commit.message }} |