Merge pull request #41 from saucelabs/IRIS-1207-add-more-items #24
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: | |
tags: | |
- '*' | |
jobs: | |
publish: | |
timeout-minutes: 10 | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Setup java | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 11 | |
- name: Setup Android SDK | |
uses: android-actions/setup-android@v2 | |
- name: Detect version from release tag | |
run: | | |
echo "CI_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
shell: bash | |
- name: Set app version and bump version code | |
uses: chkfung/[email protected] | |
with: | |
gradlePath: app/build.gradle | |
versionCode: ${{ github.run_number }} | |
versionName: ${{ env.CI_TAG }} | |
- name: Compile APK | |
run: | | |
./gradlew app:assembleDebug | |
./gradlew app:assembleDebugAndroidTest | |
mv app/build/outputs/apk/debug/app-debug.apk app/build/outputs/apk/debug/mda-${{ env.CI_TAG }}-${{ github.run_number }}.apk | |
mv app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk app/build/outputs/apk/debug/mda-androidTest-${{ env.CI_TAG }}-${{ github.run_number }}.apk | |
shell: bash | |
- name: Upload release artifacts | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: Version ${{ env.CI_TAG }} | |
tag_name: ${{ env.CI_TAG }} | |
fail_on_unmatched_files: true | |
prerelease: false | |
files: | | |
app/build/outputs/apk/debug/mda-${{ env.CI_TAG }}-${{ github.run_number }}.apk | |
app/build/outputs/apk/debug/mda-androidTest-${{ env.CI_TAG }}-${{ github.run_number }}.apk | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |