Created
December 10, 2023 18:28
-
-
Save Mastersam07/6274ae046a81b4d15f1f36a60c372cb4 to your computer and use it in GitHub Desktop.
Yaml to build and upload apk to diawi
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: CI | |
on: | |
push: | |
branches: [master, staging] | |
paths: | |
- 'lib/**' | |
- 'pubspec.yaml' | |
- '.github/**' | |
- 'android/**' | |
- 'ios/**' | |
- 'assets/**' | |
pull_request: | |
branches: [master, staging] | |
paths: | |
- 'lib/**' | |
- 'pubspec.yaml' | |
- '.github/**' | |
- 'android/**' | |
- 'ios/**' | |
- 'assets/**' | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup flutter 🛠️ | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: "stable" | |
cache: true | |
- name: Fetch dependencies 🛜 ↙️ | |
run: flutter packages get | |
- name: Analyze project 🧐 | |
run: flutter analyze . | |
- name: Run tests 🧪 | |
run: flutter test --coverage | |
- name: Upload coverage reports to Codecov 🔖 | |
uses: codecov/codecov-action@v3 | |
with: | |
file: ./coverage/lcov.info | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Build apk 📱 | |
if: ${{ github.event_name == 'pull_request' }} | |
run: flutter build apk --release --obfuscate --split-debug-info=. | |
- name: Upload binary to diawi 🛜 ↗️ | |
id: diawi_upload | |
if: ${{ github.event_name == 'pull_request' }} | |
uses: rnkdsh/action-upload-diawi@v1.5.4 | |
with: | |
token: ${{ secrets.ALFRED_DIAWI_TOKEN }} | |
file: ./build/app/outputs/flutter-apk/app-release.apk | |
- name: Comment apk link | |
if: ${{ github.event_name == 'pull_request' }} | |
uses: thollander/actions-comment-pull-request@v2 | |
with: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
message: | | |
Hello Team :wave: | |
There is a new build available | |
Diawi Link: ${{ steps.diawi_upload.outputs.url }} | |
![QR Code](${{ steps.diawi_upload.outputs.qrcode }}) | |
reactions: rocket |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment