Skip to content

Commit

Permalink
workflow update
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaCoduriV committed Sep 23, 2022
1 parent 4d9a682 commit 9745b3b
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 39 deletions.
68 changes: 33 additions & 35 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,39 @@ name: CD - Create a new release
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
tags:
- "v*.*.*" # on every version tag will build a new android artifact.
push:
tags:
- "v*.*.*" # on every version tag will build a new android artifact.
jobs:
build:
name: Build APK
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: "12.x"
- name: Setup Flutter
uses: subosito/flutter-action@v1
with:
flutter-version: "3.3.0"
build:
name: Build APK
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: "12.x"
- name: Setup Flutter
uses: subosito/flutter-action@v1
with:
flutter-version: "3.3.0"

- name: Pub Get Packages
run: flutter pub get
- name: Pub Get Packages
run: flutter pub get

- name: Build APK
env:
KEY_PROP: ${{ secrets.KEY_PROP }}
KEY_JKS: ${{ secrets.KEY_JKS }}
KEY_PASSWORD: ${{ secrets.ALIAS_PASSWORD }}
ALIAS_PASSWORD: ${{ secrets.KEY_PASSWORD }}
run: echo $KEY_JKS | base64 --decode > upload-keystore.jks && echo $KEY_PROP| base64 --decode > ./android/key.properties && flutter pub get && flutter build apk --release --dart-define=SERVER_IP_PROD=${{ secrets.SERVER_IP_PROD }} --dart-define=PORT_PROD=${{ secrets.PORT_PROD }}

- name: Create Github Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: Careot release ${{ github.ref_name }}
files: |
build/app/outputs/apk/release/*.apk
- name: Build APK
env:
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
KEY_JKS: ${{ secrets.KEY_JKS }}
run: echo $KEY_JKS | base64 --decode > upload-keystore.jks && && flutter pub get && flutter build apk --release --dart-define=SERVER_IP_PROD=${{ secrets.SERVER_IP_PROD }} --dart-define=PORT_PROD=${{ secrets.PORT_PROD }}

- name: Create Github Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: Careot release ${{ github.ref_name }}
files: |
build/app/outputs/apk/release/*.apk
8 changes: 4 additions & 4 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ android {

signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
storeFile file("../upload-keystore.jks")
keyAlias = "upload"
keyPassword System.getenv('KEY_PASSWORD') ?: keystoreProperties['keyPassword']
storePassword System.getenv('STORE_PASSWORD') ?: keystoreProperties['storePassword']
}
}
buildTypes {
Expand Down

0 comments on commit 9745b3b

Please sign in to comment.