Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save narayann7/bc16afec4ce2d59c25e8703460ac57d6 to your computer and use it in GitHub Desktop.

Select an option

Save narayann7/bc16afec4ce2d59c25e8703460ac57d6 to your computer and use it in GitHub Desktop.

Revisions

  1. narayann7 created this gist Apr 22, 2023.
    31 changes: 31 additions & 0 deletions flutter_build_apk_and_send_it_slack_channel.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,31 @@
    ```
    name: Flutter CI
    on:
    push:
    branches:
    - main
    pull_request:
    branches:
    - main
    jobs:
    build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - uses: actions/setup-java@v1
    with:
    java-version: "12.x"
    - uses: subosito/flutter-action@v1
    with:
    channel: "beta"
    - run: flutter pub get
    - run: flutter analyze .
    - run: flutter build apk --release
    - run: mv build/app/outputs/flutter-apk/app-release.apk .
    - run: mv app-release.apk ${{ secrets.APP_NAME }}.apk
    - run: |
    curl -F file=@${{ secrets.APP_NAME }}.apk -F "initial_comment=${{ secrets.COMMIT_URL }}$(git rev-parse HEAD)" -F channels=${{ secrets.SLACK_CHANNEL_ID }} -H "Authorization: Bearer ${{ secrets.SLACK_TOKEN }}" https://slack.com/api/files.upload
    ```