Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push the apk to release #4

Closed
asjqkkkk opened this issue Sep 3, 2019 · 7 comments
Closed

Push the apk to release #4

asjqkkkk opened this issue Sep 3, 2019 · 7 comments

Comments

@asjqkkkk
Copy link

asjqkkkk commented Sep 3, 2019

Hello,I want to know how to put the apk file generated by the github-action into the release of my github project.馃槉馃槉

@subosito
Copy link
Owner

subosito commented Sep 4, 2019

You can use another action for that purpose, like, https://github.com/marketplace/actions/github-action-publish-binaries. So, you can:

steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
  with:
    java-version: '12.x'
- uses: subosito/flutter-action@v1
  with:
    flutter-version: '1.7.8+hotfix.4'
- run: flutter pub get
- run: flutter test
- run: flutter build apk
- uses: skx/github-action-publish-binaries@master
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  with:
    args: 'build/app/outputs/apk/release/app-release.apk'

@asjqkkkk
Copy link
Author

asjqkkkk commented Sep 5, 2019

@subosito
Thank you!
But after I changed my yml file to:

name: Flutter CI

on:
  push:
    branches:
      - dev
      - master
      - action_test

jobs:
  test:
    name: Test on ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest]
#        os: [ubuntu-latest, windows-latest, macos-latest]
    steps:
      - uses: actions/checkout@v1
      - uses: actions/setup-java@v1
        with:
          java-version: '12.x'
      - uses: subosito/flutter-action@v1
        with:
          flutter-version: '1.7.8+hotfix.4'
          channel: 'stable'
      - run: flutter packages get
      - run: flutter test
      - run: flutter build apk --target-platform android-arm --split-per-abi
      - run: ls
      - run: mv build/app/outputs/apk/release/app-armeabi-v7a-release.apk build/app-armeabi-v7a-release.apk
      - uses: skx/github-action-publish-binaries@master
        env:
          GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }}
        with:
          args: 'build/app-armeabi-v7a-release.apk'

#      - run: curl

The github-action logs:

image

image

Could you give me some help?馃槉馃槉

@asjqkkkk
Copy link
Author

asjqkkkk commented Sep 5, 2019

image
And I have set the token

@mirkancal
Copy link

Mine return succesful and provide me a apk link.

https://uploads.github.com/repos/mirkancal/{repo_name}/releases/null/assets?name=app-release.apk

However I can't see it on releases tab, also I can't view it via link.
Link returns this json.

{"message":"Bad Content-Length: ","request_id":"{id of the request}"}

My project is in the private repo, is it related?

.yml I had is:

name: Flutter Release Apk

on: [push, pull_request]

jobs:
  test:
    name: Test on ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest]
    steps:
      - uses: actions/checkout@v1
      - uses: actions/setup-java@v1
        with:
          java-version: '12.x'
      - uses: subosito/flutter-action@v1
        with:
          channel: 'stable'
      - run: flutter pub get
      - run: flutter test
      - run: flutter build apk
      - uses: skx/github-action-publish-binaries@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          args: 'build/app/outputs/apk/release/app-release.apk'

@nabilnalakath
Copy link
Contributor

I was able to push the APK to release using a different github action. You can read about it here - https://link.medium.com/1q1D4Fgbv0

@tianhaoz95
Copy link
Contributor

tianhaoz95 commented Oct 7, 2019

Hi @nabilnalakath, my workflow pushes to actions storage fine, you can take a look at this workflow file:

deploy-android:
    name: Deploy Android app
    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:
          flutter-version: '1.9.1+hotfix.4'
          channel: 'stable'
      - run: cd ./iwfpapp && flutter build apk  --release
      - name: upload artifects
        uses: actions/upload-artifact@master
        with:
          name: android-app
          path: iwfpapp/build/app/outputs

@subosito
Copy link
Owner

Awesome, closing this then 馃憤

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants