v2.1.0 #7
Workflow file for this run
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: Publish APK | |
on: | |
# push: | |
# branches: | |
# - develop | |
# - master | |
# - 2x | |
release: | |
types: [published] | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v1 | |
- name: Setup Java | |
uses: actions/setup-java@v1 | |
with: | |
java-version: '11.x' | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v1 | |
with: | |
channel: 'stable' # 'dev', 'alpha', default to: 'stable' | |
#flutter-version: '1.22.x' | |
# fix Permission denied | |
- name: Setup Permission | |
run: sudo chown -R $USER $PWD | |
- name: Build APK | |
run: cd example && flutter build apk | |
- name: Upload to Pgyer | |
run: | | |
result=$(curl -F 'file=@example/build/app/outputs/apk/release/app-release.apk' -F '_api_key=${{ secrets.PGYER_API_KEY }}' https://www.pgyer.com/apiv2/app/upload) | |
if [[ $result != *"{\"code\":0"* ]]; then | |
echo 'result:'$result | |
echo "Upload Pgyer Failed !!!" | |
exit 1 | |
fi | |
echo "Upload Pgyer Success" | |