Blog Infos
Author
Published
Topics
,
Published

Lets build some Pipelines.

 

https://unsplash.com/photos/9AxFJaNySB8

 

CI/CD for Android Devs II | GitHub Actions Masterclass

name: Build, test, and deploy Android app
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 1.8
- run: ./gradlew build
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 1.8
- run: ./gradlew test
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 1.8
- run: ./gradlew deploy
- name: Upload APK
uses: actions/upload-artifact@v1
with:
name: app-debug.apk
path: app/build/outputs/apk/debug/app-debug.apk
Github Secrets:

 

 

2. In the left menu, click on the “Secrets” option.

 

 

 

 

${{ secrets.SECRET_NAME }}

Job Offers

Job Offers


    Android Software Engineer (f/m/d)

    Paradox Cat GmbH
    Munich
    • Full Time
    apply now

    Android Test Automation Engineer

    Komoot
    Remote
    • Full Time
    apply now

    Senior Android Software Engineer (f/m/d)

    Paradox Cat GmbH
    Munich
    • Full Time
    apply now

OUR VIDEO RECOMMENDATION

, ,

How to effectively create and review PRs

In this session I want to guide the audience in how to effectively create and review PRs. Creating them has a few tips like templates and ways of automating some tasks through GitHub. The review…
Watch Video

How to effectively create and review PRs

Alessandro Mautone
Android Engineer
WeTransfer

How to effectively create and review PRs

Alessandro Mautone
Android Engineer
WeTransfer

How to effectively create and review PRs

Alessandro Mauto ...
Android Engineer
WeTransfer

Jobs

Automating Firebase App Distribution:
#upload qa flavour  apk to firebase app tester using github actions
name: Firebase App Tester QA
on:
  push:
    branches:
      - "QA"
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-java@v1
        with:
          java-version: 11
      - uses: actions/cache@v2
        with:
          path: ~/.gradle/caches
          key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
          restore-keys: |
            ${{ runner.os }}-gradle-
      - name: Build QA Flavour APK
        run: ./gradlew assembleQaDebug
      - name: Upload QA Flavour APK to Firebase App Tester
        uses: wzieba/Firebase-Distribution-Github-Action@v1
        with:
          appId: ${{ secrets.QA_APP_ID }}
          serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }}
          groups: qa-internal
          releaseNotes: ${{ github.event.head_commit.message }}
          file: app/build/outputs/apk/qa/debug/app-qa-debug.apk
- uses: actions/checkout@v2

2. The second step uses the actions/setup-java action to set up Java on the virtual machine. This is necessary because the Android app is built using Gradle, which requires Java. The java-version key specifies the version of Java to install, which is set to 11 in this example.

- uses: actions/setup-java@v1
  with:
    java-version: 11
- uses: actions/cache@v2
  with:
    path: ~/.gradle/caches
    key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
    restore-keys: |
      ${{ runner.os }}-gradle-
- name: Build QA Flavour APK
  run: ./gradlew assembleQaDebug
- name: Upload QA Flavour APK to Firebase App Tester
  uses: wzieba/Firebase-Distribution-Github-Action@v1
  with:
    appId: ${{ secrets.QA_APP_ID }}
    serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }}
    groups: qa-internal
    releaseNotes: ${{ github.event.head_commit.message }}
    file: app/build/outputs/apk/qa/debug/app-qa-debug.apk

Another example:

name: Upload App Bundle to Play Store
on: [push]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-java@v1
        with:
          java-version: 1.8
      - uses: actions/cache@v2
        with:
          path: ~/.gradle/caches
          key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
          restore-keys: |
            ${{ runner.os }}-gradle-
      - name: Build App Bundle
        run: ./gradlew bundleRelease
      - name: Upload App Bundle to Play Store
        uses: r0adkll/upload-google-play@v2
        with:
          package-name: com.example.app
          release-status: completed
          service-account-json: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT }}
          track: production
          app-bundle: app/build/outputs/bundle/release/app-release.aab
          release-notes-file: release-notes.txt

This article was originally published on proandroiddev.com on December 12, 2022

YOU MAY BE INTERESTED IN

YOU MAY BE INTERESTED IN

blog
Life is hard. We are engulfed in tasks that take time, are boring, and…
READ MORE
blog
There are a lot of blogs and videos on why we need CI/CD. From…
READ MORE
blog
When you edit your Github Actions workflows it would be nice to have a…
READ MORE
blog
This post is a continuation of the previous post. If you didn’t read the…
READ MORE

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.

Menu