Setup CI CD 21π«ΈπβοΈπ #1
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: Deploy Android App on AppCenter | ||
on: | ||
workflow_call: | ||
inputs: | ||
file: | ||
description: 'The path to the file to be released' | ||
required: true | ||
type: string | ||
name: | ||
description: 'QuranPERSIS' | ||
required: true | ||
type: string | ||
group: | ||
description: 'The group that will have access to the version released' | ||
required: false | ||
type: string | ||
default: '"Collaborators"' | ||
jobs: | ||
build: | ||
name: Build .apk file | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
# The flutter action needs java so include it | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
- uses: subosito/flutter-action@v2 | ||
with: | ||
channel: 'stable' | ||
# Get flutter packages | ||
- run: flutter pub get | ||
# Build :D | ||
- run: flutter build aot | ||
- run: flutter build apk --release --verbose | ||
# - name: Create Release | ||
# uses: ncipollo/[email protected] | ||
# with: | ||
# artifacts: "build/app/outputs/apk/release/*.apk" | ||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: APK_Releases | ||
path: | | ||
build/app/outputs/flutter-apk/app-release.apk | ||
build/app/outputs/bundle/release/app-release.aab | ||
Deploy: | ||
name: Deploy file to AppCenter | ||
needs: [ build ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: AppCenter CLI Action | ||
uses: charliealbright/[email protected] | ||
with: | ||
token: ${{secrets.APPCENTER_API_TOKEN}} | ||
command: 'appcenter distribute release -f ${{inputs.file}} --app ${{inputs.name}} --group ${{inputs.group}}' |