build(deps): bump actions/download-artifact from 3 to 4.1.7 in /.github/workflows #43
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: Android CI | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
build: | |
name: Build apk | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get latest tag | |
id: previoustag | |
run: git fetch --tags && echo "tag=$(git describe --abbrev=0 --tags $(git rev-list --tags --max-count=1)) >> $GITHUB_OUTPUT" | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: gradle | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Create local.properties | |
run: echo "GOOGLE_MAPS_API_KEY=${{ secrets.GOOGLE_MAPS_API_KEY }}" > local.properties && | |
echo "IDSBK_API_KEY=${{ secrets.IDSBK_API_KEY }}" >> local.properties | |
- name: Get apk version | |
id: apk | |
run: APK_VERSION=$(./gradlew properties -q | grep "version:" | awk '{print v$2}') && | |
echo "version=$APK_VERSION" >> $GITHUB_OUTPUT && | |
echo "tag=v$APK_VERSION" >> $GITHUB_OUTPUT | |
- name: Build signed apk | |
run: ./gradlew assembleRelease | |
-Pandroid.injected.signing.store.file=$GITHUB_WORKSPACE/transi.jks | |
-Pandroid.injected.signing.store.password=${{ secrets.KEYSTORE_PASSWORD }} | |
-Pandroid.injected.signing.key.alias=${{ secrets.KEY_ALIAS }} | |
-Pandroid.injected.signing.key.password=${{ secrets.KEYSTORE_PASSWORD }} | |
- name: Create new tag | |
if: steps.apk.outputs.tag != steps.previoustag.outputs.tag | |
run: git tag ${{ steps.apk.outputs.tag }} && git push --tags && git fetch --tags | |
- name: Generate changelog | |
if: steps.apk.outputs.tag != steps.previoustag.outputs.tag | |
id: changelog | |
uses: magicsk/tag-changelog-multiline@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
config_file: .github/tag-changelog-config.js | |
- name: Create Release | |
if: steps.apk.outputs.tag != steps.previoustag.outputs.tag | |
id: create_release | |
uses: actions/create-release@latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.apk.outputs.tag }} | |
release_name: Transi ${{ steps.apk.outputs.tag }} | |
body: ${{ steps.changelog.outputs.changes }} | |
- name: Upload apk | |
uses: actions/upload-artifact@v3 | |
with: | |
name: app-release | |
path: app/build/outputs/apk/release/app-release.apk | |
- name: Upload release asset | |
if: steps.apk.outputs.tag != steps.previoustag.outputs.tag | |
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/release/app-release.apk | |
asset_name: eu.magicsk.transi.${{ steps.apk.outputs.version }}.apk | |
asset_content_type: application/octet-stream | |
firebase: | |
name: Run UI tests with Firebase Test Lab | |
needs: build | |
runs-on: ubuntu-latest | |
permissions: | |
contents: 'read' | |
id-token: 'write' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download app APK | |
uses: actions/[email protected] | |
with: | |
name: app-release | |
- name: Login to Google Cloud | |
id: auth | |
uses: google-github-actions/auth@v0 | |
with: | |
credentials_json: ${{ secrets.FIREBASE_SERVICE_KEY }} | |
- name: Set up Cloud SDK | |
uses: google-github-actions/setup-gcloud@v0 | |
- id: gcloud | |
name: Run Firebase Robo test | |
run: gcloud config set project ${{ secrets.FIREBASE_PROJECT_ID }} && | |
gcloud firebase test android run | |
--app app-release.apk | |
--device model=oriole,version=33,locale=en,orientation=portrait | |
--device model=phoenix_sprout,version=28,locale=en,orientation=portrait |