Skip to content

Commit

Permalink
Setup CI CD 4 πŸ«ΈπŸŒ€βœοΈπŸ“— :octocat:
Browse files Browse the repository at this point in the history
  • Loading branch information
hendisantika committed Jan 17, 2024
1 parent 990e875 commit 3e1ed9f
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/app_center.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Deploy Flutter App on AppCenter
on:
push:
branches:
- main
- 'releases/**'
jobs:
setup-flutter:
name: Setup Flutter
runs-on: self-hosted
steps:
- run: echo "πŸŽ‰ Triggered by a ${{ github.event_name }} on ${{ github.ref }}"
- name: Check out repository code
uses: actions/checkout@v3
- name: Install jq
uses: dcarbone/install-jq-action@v2.0.2
- uses: subosito/flutter-action@v2
with:
channel: master
architecture: x64
- run: flutter pub get
setup-appcenter-cli: # must have node and npm installed!
name: Setup AppCenter CLI
runs-on: self-hosted
steps:
- name: Install appcenter-cli
uses: charliealbright/appcenter-cli-action@v1.0.1
with:
token: '${{secrets.APPCENTER_API_TOKEN}}'
command: 'appcenter help'
# deploy_iOS:
# name: Deploy iOS
# needs: [setup-flutter, setup-appcenter-cli]
# uses: ./.github/workflows/deploy_ios.yml
deploy_android:
name: Deploy Android
needs: [ setup-flutter, setup-appcenter-cli ]
uses: ./.github/workflows/deploy_android.yml
secrets: inherit
with:
file: './build/app/outputs/apk/release/app-release.apk'
name: 'AlvaroBarrosC/GithubAction-Android'
33 changes: 33 additions & 0 deletions .github/workflows/deploy_android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
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: 'The name of the app'
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: self-hosted
steps:
- run: flutter build apk --release --verbose
Deploy:
name: Deploy file to AppCenter
needs: [ build ]
runs-on: self-hosted
steps:
- name: AppCenter CLI Action
uses: charliealbright/appcenter-cli-action@v1.0.1
with:
token: ${{secrets.APPCENTER_API_TOKEN}}
command: 'appcenter distribute release -f ${{inputs.file}} --app ${{inputs.name}} --group ${{inputs.group}}'
16 changes: 16 additions & 0 deletions .github/workflows/deploy_ios.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Deploy iOS App on AppCenter
on: workflow_call
jobs:
Build:
runs-on: self-hosted
steps:
- run: flutter build ipa --release --verbose --no-codesign
# Deploy:
# needs: Build
# runs-on: self-hosted
# steps:
# - name: AppCenter CLI Action
# uses: charliealbright/appcenter-cli-action@v1.0.1
# with:
# token: '${{secrets.APPCENTER_API_TOKEN}}'
# command: 'appcenter apps show'

0 comments on commit 3e1ed9f

Please sign in to comment.