<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Sagar Viradiya</title>
    <description>The latest articles on DEV Community by Sagar Viradiya (@sagarviradiya).</description>
    <link>https://dev.to/sagarviradiya</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F202684%2Fb09950c5-12e2-43ef-9840-54f3fd5118ff.png</url>
      <title>DEV Community: Sagar Viradiya</title>
      <link>https://dev.to/sagarviradiya</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sagarviradiya"/>
    <language>en</language>
    <item>
      <title>Modern Android app distribution with GitHub Actions Part - II</title>
      <dc:creator>Sagar Viradiya</dc:creator>
      <pubDate>Wed, 18 Nov 2020 15:31:20 +0000</pubDate>
      <link>https://dev.to/sagarviradiya/modern-android-app-distribution-with-github-actions-part-ii-akk</link>
      <guid>https://dev.to/sagarviradiya/modern-android-app-distribution-with-github-actions-part-ii-akk</guid>
      <description>&lt;h6&gt;
  
  
  &lt;span&gt;Photo by &lt;a href="https://unsplash.com/@hdbernd?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Bernd Dittrich&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/truck?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/span&gt;
&lt;/h6&gt;

&lt;p&gt;Hola folks 👋 , I'm back with part 2 of Modern Android app Distribution. In the first part, we saw how to automate the internal distribution using GitHub Actions and Internal App sharing. If you missed the first part you can check it 👇&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/sagarviradiya" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F202684%2Fb09950c5-12e2-43ef-9840-54f3fd5118ff.png" alt="sagarviradiya"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/sagarviradiya/modern-android-app-distribution-with-github-actions-part-i-5pp" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Modern Android app distribution with GitHub Actions Part - I&lt;/h2&gt;
      &lt;h3&gt;Sagar Viradiya ・ Aug 25 '20&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#android&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#github&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;In this part, we will see how to automate your production release through GitHub Actions and test track.&lt;/p&gt;

&lt;h1&gt;
  
  
  Automating app release through the test track
&lt;/h1&gt;

&lt;p&gt;In the first part, we saw Internal app distribution which allows you to quickly share development builds. At &lt;a href="https://in.bookmyshow.com" rel="noopener noreferrer"&gt;BookMyShow&lt;/a&gt; we distribute our feature level builds for QA through &lt;a href="https://support.google.com/googleplay/android-developer/answer/9844679?hl=en&amp;amp;visit_id=637411981827269812-1035070845&amp;amp;rd=1" rel="noopener noreferrer"&gt;Internal App Sharing&lt;/a&gt;. But what about a formal internal launch of the integrated build before you go live with the release? Test track allows you to distribute your build to a limited set of audience to test it out and get valuable feedback. Play console offers three tracks to distribute your build.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Internal (Limited to 100 testers)&lt;/li&gt;
&lt;li&gt;Closed (Closed group which is invite-only)&lt;/li&gt;
&lt;li&gt;Open (Anyone can join the testing program)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Once you are happy with your build you can promote it to closed, open, or production track depending on your current track. Read more about test tracks &lt;a href="https://support.google.com/googleplay/android-developer/answer/9845334?hl=en" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Let's see how to automate this process. At a high level, we are looking at this.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Trigger for release build --&amp;gt; Build --&amp;gt; Distribute to one of the track&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let's build our workflow.&lt;/p&gt;

&lt;p&gt;You need to decide on an event that will trigger your workflow. Since we are talking about pre-release distribution usually it is from the release branch and the event which will trigger the build has to be more specific. Tagging a release could be one of the events to trigger release build. Let's see how to achieve this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Internal release&lt;/span&gt;
&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;tags&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;[1-9]+.[0.9]+.[0.9]+'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;As you can see you need to specify regex for your version name style and every time you tag your release it will trigger our workflow.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Note: Please make sure to bump the version name and version code before tagging your release.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now we need to configure the build job.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Building release app&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Checking out tag&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v2&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Settting up JDK &lt;/span&gt;&lt;span class="m"&gt;1.8&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/setup-java@v1&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;java-version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1.8&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Runing build command&lt;/span&gt;
        &lt;span class="c1"&gt;# Run your own gradle command to generate release build.&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;./gradlew bundleRelease&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Uploading build&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/upload-artifact@v2&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;bundle&lt;/span&gt;
          &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;app/build/outputs/bundle/release/app-release.aab&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This is very similar to the one we saw in the previous part.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Note: In case you are uploading apk you might need to upload mapping.txt as well which contains the obfuscated class, method, and field names mapped to the original names. This mapping file also contains information to map the line numbers back to the original source file line numbers. This file is required by Google Play to deobfuscate incoming stack traces from user-reported issues so you can review them in the Google Play Console.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The final job is to upload our build on the test track. Let's see how to achieve that.&lt;/p&gt;

&lt;p&gt;First, we need to download our build that we uploaded in the previous job.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Note: In case you uploaded apk file in the previous job you need to upload a mapping file as well and the same you need to download.&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;upload_to_test_track&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Uploading build to Internal test track&lt;/span&gt;
    &lt;span class="na"&gt;needs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;build&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Downloading build&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/download-artifact@v2&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;bundle&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;After downloading it is just a matter of using a GitHub Action for uploading build on the test track. You can use &lt;a href="https://github.com/marketplace/actions/upload-android-release-to-play-store" rel="noopener noreferrer"&gt;r0adkll/upload-google-play@v1&lt;/a&gt; action.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Uploading to test track&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;r0adkll/upload-google-play@v1&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="c1"&gt;# Your service account JSON GitHub secret&lt;/span&gt;
          &lt;span class="na"&gt;serviceAccountJsonPlainText&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.[your-github-service-acc-json-secret] }}&lt;/span&gt;
          &lt;span class="c1"&gt;# Your package name&lt;/span&gt;
          &lt;span class="na"&gt;packageName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;your-package-name'&lt;/span&gt;
          &lt;span class="na"&gt;releaseFiles&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;app-release.aab&lt;/span&gt;
          &lt;span class="na"&gt;track&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;internal&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The key things that you need to specify are&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Your service account JSON file as a plain text (Or as a JSON file) through GitHub secret.&lt;/li&gt;
&lt;li&gt;Your application package name.&lt;/li&gt;
&lt;li&gt;Track you want to upload build to(internal/production/alpha/beta).&lt;/li&gt;
&lt;li&gt;Mapping file (In case you upload apk file)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The action also allows you to specify a bunch of other things but all of the above are important parameters that are mandatory.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Note: If you are uploading bundle you need to enroll in app signing by Google Play before uploading your app bundle on the Play Console. Read more about it &lt;a href="https://support.google.com/googleplay/android-developer/answer/9842756?hl=en" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Congratulations! Your workflow for automating internal as well as production release is ready 💪&lt;/p&gt;

&lt;p&gt;Here is gist of the full workflow 👇&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;This brings to an end of the two-part series on Modern Android app Distribution with GitHub Actions. Hope you guys had fun learning automating your build and distribution process. As always feedbacks are welcome so please comment or reach out to me on &lt;a href="https://twitter.com/viradiya_sagar" rel="noopener noreferrer"&gt;twitter&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;That's it for now folks. Until next time 👋. Happy coding :)&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Thanks to &lt;a href="https://twitter.com/AkshanshD" rel="noopener noreferrer"&gt;Akshansh&lt;/a&gt; and &lt;a href="https://twitter.com/cortinico" rel="noopener noreferrer"&gt;Nicola Corti&lt;/a&gt; for proofreading this.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>android</category>
      <category>github</category>
    </item>
    <item>
      <title>Modern Android app distribution with GitHub Actions Part - I</title>
      <dc:creator>Sagar Viradiya</dc:creator>
      <pubDate>Tue, 25 Aug 2020 15:09:50 +0000</pubDate>
      <link>https://dev.to/sagarviradiya/modern-android-app-distribution-with-github-actions-part-i-5pp</link>
      <guid>https://dev.to/sagarviradiya/modern-android-app-distribution-with-github-actions-part-i-5pp</guid>
      <description>&lt;h6&gt;
  
  
  &lt;span&gt;Photo by &lt;a href="https://unsplash.com/@hdbernd?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Bernd Dittrich&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/truck?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/span&gt;
&lt;/h6&gt;

&lt;p&gt;Hey folks 👋 , First thing first, I hope everyone is safe and sound. With that out of way, let me ask you a couple of questions about your build/distribution cycle :&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Do you manually create a build for your testing?&lt;/li&gt;
&lt;li&gt;Are you still distributing your app over email/G-drive?&lt;/li&gt;
&lt;li&gt;Want to automate the process of building and distributing?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you answered yes to any of those questions, you need to stop what you're doing right now and automate your build/distribution cycle.&lt;/p&gt;

&lt;p&gt;This is a 2 part series on Modern Android Distribution with GitHub Actions. I am going to help you automate your app distribution through GitHub Actions. So let's get started.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This blog assumes that you are well versed with GitHub Actions. If not then I highly recommend exploring it and come back.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In this part, we will be looking at how to automate internal app distribution through Internal App Sharing. &lt;/p&gt;

&lt;h1&gt;
  
  
  Automating internal app distribution through Internal App Sharing
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://support.google.com/googleplay/android-developer/answer/9303479?hl=en"&gt;Internal App Sharing&lt;/a&gt; is an excellent tool on Play console which allows you to share aab/apk internally with your QA and other stakeholders. At &lt;a href="https://in.bookmyshow.com"&gt;BookMyShow&lt;/a&gt; we are using it for sharing feature builds and integrated builds with QA. The whole experience is as good as installing an app from the play store except it is restricted to whitelisted emails. No more sideloading needed, and if that wasn't good enough, you could even integrate it into your workflow to share it on Slack once you upload apk/aab to Internal App Sharing(IAS). &lt;/p&gt;

&lt;p&gt;At a high level, we are looking at this&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Build  --&amp;gt;  Upload aab/apk to IAS  --&amp;gt;  Share link from the previous step on Slack.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let's build our workflow.&lt;/p&gt;

&lt;p&gt;You need to decide on an event that will trigger your workflow. It could be a push event to a specific branch or &lt;a href="https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#triggering-a-workflow-with-events"&gt;some other event&lt;/a&gt;. In most of the cases, it is a push event to a branch from where you are sharing internal build to QA. Let's configure that first.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Build, Upload to IAS and share on slack.&lt;/span&gt;
&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;branches&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="c1"&gt;# Specify branch from where you are sharing build&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;branch_name&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Now let's see how to configure the build step we discussed earlier.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Building app&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Checking out branch&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v2&lt;/span&gt;
          &lt;span class="s"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="c1"&gt;# Specify branch from where you are sharing build        &lt;/span&gt;
            &lt;span class="na"&gt;ref&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;[branch_name]'&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Settting up JDK &lt;/span&gt;&lt;span class="m"&gt;1.8&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/setup-java@v1&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;java-version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1.8&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Runing build command&lt;/span&gt;
        &lt;span class="c1"&gt;# Run your own gradle command to generate build.&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;./gradlew bundleRelease&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Uploading build&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/upload-artifact@v2&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;bundle&lt;/span&gt;
          &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;app/build/outputs/bundle/release/app-release.aab&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;As you can see, build job has four tasks. This job, as we have specified, runs on an instance of a Linux machine. Just like how you would checkout branch on your new machine when you setup any project the same way here too you need to checkout branch from where you would like to create a build. The first step does that using a custom action &lt;strong&gt;&lt;code&gt;actions/checkout@v2&lt;/code&gt;&lt;/strong&gt;. Next, we need to setup JDK so that we can compile our project. The second step does that using a custom action &lt;strong&gt;&lt;code&gt;actions/setup-java@v1&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Now our virtual Linux instance is ready with all setups; it's time to execute Gradle command to create a bundle(You can build apk too if you are not using bundle). The next step does that and creates a bundle file. Finally, the last step uploads our generated bundle so that we access it later in our next job - notice we have given name to our artifact called &lt;strong&gt;&lt;em&gt;'bundle'&lt;/em&gt;&lt;/strong&gt; so that we can refer it later. Also, we have mentioned the file path to our bundle to be uploaded. If you want to share a file across jobs this is how you can achieve it. It uses custom action &lt;strong&gt;&lt;code&gt;actions/upload-artifact@v2&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Alright so we are halfway through our workflow and so far we have managed to build and store our bundle on artifact so that we can use it in our next job.&lt;/p&gt;

&lt;p&gt;Let's move on to our next job but before that…&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/26hitpANolPjPmoCc/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/26hitpANolPjPmoCc/giphy.gif" alt="KiKat break gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I promise KitKat hasn't paid me for this 🤞&lt;/p&gt;

&lt;p&gt;Ready? Let's move on then! &lt;/p&gt;

&lt;p&gt;Since the last job is quite complex we will break it down stepwise.&lt;/p&gt;

&lt;p&gt;Each job runs on a different instance of a Linux machine. Just how we configured our previous job, this job too runs on an instance of Linux.&lt;/p&gt;

&lt;p&gt;Notice special &lt;strong&gt;&lt;em&gt;'needs'&lt;/em&gt;&lt;/strong&gt; tag at line number 3 below. That tells GitHub that this job has a dependency on the name specified. In our case, it is build job.&lt;/p&gt;

&lt;p&gt;Our final job has 3 steps. First, we download the build that we stored in the last step of the previous job. We are referring to an artifact that we want to download through the name that we have given &lt;strong&gt;&lt;em&gt;'bundle'&lt;/em&gt;&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;upload_to_internal_app_sharing&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Uploading build to IAS&lt;/span&gt;
    &lt;span class="na"&gt;needs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;build&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Downloading build&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/download-artifact@v2&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;bundle&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Once we have bundle it's time to upload it to Internal App Sharing. Also, it's time for a shameless plug 🙈&lt;/p&gt;

&lt;p&gt;My fellow engineers at BookMyShow and me wrote a custom GitHub action which allows you to upload build to Internal App Sharing. Check out more about it 👇&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--i3JOwpme--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/github-logo-ba8488d21cd8ee1fee097b8410db9deaa41d0ca30b004c0c63de0a479114156f.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/sagar-viradiya"&gt;
        sagar-viradiya
      &lt;/a&gt; / &lt;a href="https://github.com/sagar-viradiya/internal-app-sharing-action"&gt;
        internal-app-sharing-action
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      GitHub Action to upload aab/apk to Internal App Sharing on Play console
    &lt;/h3&gt;
  &lt;/div&gt;
&lt;/div&gt;



&lt;p&gt;Just like other custom actions that we have seen so far, we will be using this to upload our build to Internal App Sharing.&lt;/p&gt;

&lt;p&gt;This action requires 3 things to upload your build to IAS.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Your service account JSON in text format(We recommend to set it in your GitHub secret)&lt;/li&gt;
&lt;li&gt;Your application's package name.&lt;/li&gt;
&lt;li&gt;And the path to your build.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For the first two of those, you need to replace with your service account JSON as GitHub secret. The last one would be simply a file name since downloaded artifact would be at the root level unless you specify a custom path. In case you specify custom path while downloading please make sure you use the same path here.&lt;/p&gt;

&lt;p&gt;Action spits out 3 outputs&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;downloadUrl&lt;/code&gt; - The download URL generated for the uploaded artifact.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;certificateFingerprint&lt;/code&gt; - The SHA256 fingerprint of the certificate used to sign the generated artifact.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;sha256&lt;/code&gt; - The SHA-256 hash of the artifact.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here is the step for uploading to Internal App Sharing.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Uplaoding to IAS&lt;/span&gt;
        &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ias&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;sagar-viradiya/internal-app-sharing-action@v1.1.0&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="c1"&gt;# Your service account JSON GitHub secret&lt;/span&gt;
          &lt;span class="na"&gt;serviceAccountJsonPlainText&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.[your-github-service-acc-json-secret] }}&lt;/span&gt;
          &lt;span class="c1"&gt;# Your package name &lt;/span&gt;
          &lt;span class="na"&gt;packageName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;[your-package-name]'&lt;/span&gt;
          &lt;span class="na"&gt;aabFilePath&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;app-release.aab'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;In our next and final step, we notify &lt;strong&gt;&lt;em&gt;&lt;code&gt;downloadUrl&lt;/code&gt;&lt;/em&gt;&lt;/strong&gt; output from above step on slack. Again it is using custom action &lt;strong&gt;&lt;code&gt;rtCamp/action-slack-notify@v2.1.0&lt;/code&gt;&lt;/strong&gt;. You need to mention the following :&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Your slack webhook.&lt;/li&gt;
&lt;li&gt;Channel where you want to notify.&lt;/li&gt;
&lt;li&gt;Message - In our case &lt;code&gt;downloadUrl&lt;/code&gt; output from previous step.&lt;/li&gt;
&lt;li&gt;Title (Default would be 'Message').&lt;/li&gt;
&lt;li&gt;Slack user name (Default would be 'rtBot') - The name of the sender of the message. Does not need to be a "real" username.
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Sharing on slack&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;rtCamp/action-slack-notify@v2.1.0&lt;/span&gt;
        &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="c1"&gt;# Your slack webhook GitHub secret&lt;/span&gt;
          &lt;span class="na"&gt;SLACK_WEBHOOK&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.[your-slack-webhook] }}&lt;/span&gt;
          &lt;span class="c1"&gt;# Slack channel where you want to notify&lt;/span&gt;
          &lt;span class="na"&gt;SLACK_CHANNEL&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;your-channel&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
          &lt;span class="na"&gt;SLACK_USERNAME&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;JARVIS"&lt;/span&gt;
          &lt;span class="na"&gt;SLACK_TITLE&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Internal&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;testing&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;build"&lt;/span&gt;
          &lt;span class="na"&gt;SLACK_MESSAGE&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ steps.ias.outputs.downloadUrl }}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Wola! Your workflow for automating build and distribution through Internal app sharing is ready!&lt;/p&gt;

&lt;p&gt;Here is gist of the full workflow 👇&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;In the next one, we will be exploring how to automate your production release, so stay tuned!&lt;/p&gt;

&lt;p&gt;See you in part 2 👋&lt;/p&gt;

&lt;p&gt;Stay safe!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Thanks &lt;a href="https://twitter.com/AdnanM0123"&gt;Adnan A M&lt;/a&gt; for proofreading this.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>android</category>
      <category>github</category>
    </item>
  </channel>
</rss>
