Skip to content

Instantly share code, notes, and snippets.

@underwindfall
Created April 4, 2020 09:30
Show Gist options
  • Save underwindfall/404e49e24c3515c51d7991b56ed99eb4 to your computer and use it in GitHub Desktop.
Save underwindfall/404e49e24c3515c51d7991b56ed99eb4 to your computer and use it in GitHub Desktop.
Github Workflow Action Create Release and Add Debug.Apk as additional asset
name: Release And Update
on:
push:
tags:
- "v*"
jobs:
apk:
name: Release APK
runs-on: ubuntu-18.04
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Use Java8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Generate Debug APK
run: ./gradlew clean assembleDebug
- name: Upload APK
uses: actions/upload-artifact@v1
with:
name: apk
path: app/build/outputs/apk/debug/app-debug.apk
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get_version.outputs.VERSION }}
release_name: Release ${{ steps.get_version.outputs.VERSION }}
draft: false
prerelease: false
- name: Upload Debug APK
id: upload_release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: app/build/outputs/apk/debug/app-debug.apk
asset_name: Example.apk
asset_content_type: application/zip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment