Application CI #37
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: Application CI | |
# This workflow is triggered on pushes to the repository. | |
on: workflow_dispatch | |
# on: | |
# push: | |
# tags: | |
# - v* | |
# on: push # Default will running for every branch. | |
jobs: | |
build: | |
# This job will run on macos virtual machine | |
runs-on: macos-latest | |
steps: | |
# Setup Java environment in order to build the Android app. | |
- uses: actions/checkout@v1 | |
- run: echo "${{ secrets.ENV_FILE }}" | base64 --decode > assets/.env | |
- run: | | |
echo "${{ secrets.ANDROID_KEY_PROPERTIES }}" > android/app/key.properties | |
echo "${{ secrets.ANDROID_RELEASE_KEY }}" | base64 --decode > android/app/notely.keystore | |
- name: 'Get Previous tag' | |
id: previoustag | |
uses: "WyriHaximus/github-action-get-previous-tag@master" | |
- name: 'Get commit messages' | |
id: commitmessages | |
run: | | |
mkdir whatsNewDirectory | |
prevtag=$(git describe --abbrev=0 --tags ${{ steps.previoustag.outputs.tag }}^) | |
echo $prevtag | |
git log --pretty=format:"%s" $prevtag...${{ steps.previoustag.outputs.tag}} > commits | |
commitList=`cat commits` | |
echo ${commitList:0:400} > whatsNewDirectory/whatsnew-en-US | |
cat whatsNewDirectory/whatsnew-en-US | |
# Setup the flutter environment. | |
- name: Setup Flutter SDK | |
uses: flutter-actions/setup-flutter@v3 | |
with: | |
channel: stable | |
version: 3.27.0 | |
- run: flutter doctor -v | |
- run: flutter clean | |
# Get flutter dependencies. | |
- run: flutter pub get | |
# Statically analyze the Dart code for any errors. | |
- run: flutter analyze . | |
- name: Enable Mac Builds | |
run: flutter config --enable-macos-desktop | |
- name: Build Mac Release | |
run: flutter build macos | |
- name: Setup Files For Zipping | |
run: | | |
cd build/macos/Build/Products/Release | |
mkdir NotelyTask | |
mv NotelyTask.app NotelyTask | |
- uses: papeloto/action-zip@v1 | |
with: | |
files: build/macos/Build/Products/Release/NotelyTask | |
dest: NotelyTask.zip | |
- name: Build Release | |
run: flutter build appbundle | |
- uses: r0adkll/upload-google-play@v1.0.15 | |
with: | |
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }} | |
packageName: com.omedacore.notelytask | |
releaseFiles: build/app/outputs/bundle/release/app-release.aab | |
track: internal | |
inAppUpdatePriority: 5 | |
whatsNewDirectory: whatsNewDirectory | |
- name: Create Release New | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_REPOSITORY: dbilgin/notelytask | |
with: | |
tag_name: ${{ steps.previoustag.outputs.tag }} | |
name: ${{ steps.previoustag.outputs.tag }} | |
generate_release_notes: true | |
draft: false | |
prerelease: false | |
token: ${{ secrets.GITHUB_TOKEN }} | |
files: NotelyTask.zip |