Skip to content

Rename build actions #4

Rename build actions

Rename build actions #4

# This is a basic workflow to help you get started with Actions
name: Demo Build
# Controls when the workflow will run
on:
# Triggers the workflow on push main and any release/ branches
push:
branches:
- 'main'
- 'release/*'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Specify GITHUB_TOKEN scope for the entire workflow
permissions: read-all
# Set default values for run jobs
defaults:
run:
shell: bash
env:
CI_BUILD: true
jobs:
build:
name: App Build
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout ๐Ÿ—„
uses: actions/checkout@v3
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Setup Android Runner ๐Ÿ› ๏ธ
uses: ./.github/actions/setup-android-runner
# Gradle execution - clean
- name: Clean ๐Ÿงน
uses: gradle/gradle-build-action@v2
with:
arguments: clean
# Gradle execution - assemble with gradle scan and publish
- name: Build ๐Ÿ› ๏ธ
uses: gradle/gradle-build-action@v2
env:
SIGNING_KEYSTORE_STORE_PASSWORD: ${{ secrets.SIGNING_KEYSTORE_STORE_PASSWORD }}
SIGNING_KEYSTORE_KEY_ALIAS: ${{ secrets.SIGNING_KEYSTORE_KEY_ALIAS }}
SIGNING_KEYSTORE_KEY_PASSWORD: ${{ secrets.SIGNING_KEYSTORE_KEY_PASSWORD }}
with:
arguments: :app:assemble --scan
# Upload build artefacts
- name: Upload apk
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
retention-days: 1
name: "Build Artefacts"
path: |
app/build/outputs/apk/*/*.apk
app/build/outputs/logs/**
app/build/outputs/mapping/**
# Analyze APK
- name: Analyse Release Build - Same Repo ๐Ÿ› ๏ธ
id: apk-info-release
uses: ./.github/actions/apkanalyzer-checks
with:
file-path: app/build/outputs/apk/release/app-release.apk
# Analyze APK
- name: Analyse Debug Build - External Repo ๐Ÿ› ๏ธ
id: apk-info-debug
uses: theappbusiness/apkanalyzer-checks@main
with:
file-path: app/build/outputs/apk/debug/app-debug.apk
generate-summary: false
- name: Capture Info from APK Analyze
run: |
{
echo "### Outputs from apkanalyzer-checks action"
echo ""
echo "| Description | File Size | Download Size | Download Size Bytes |"
echo "| ----------- | --------- | ------------- | ------------------- |"
echo "| Release | ${{ steps.apk-info-release.outputs.apk-file-size }} | ${{ steps.apk-info-release.outputs.apk-download-size }} | ${{ steps.apk-info-release.outputs.apk-download-size-bytes }} |"
echo "| Debug | ${{ steps.apk-info-debug.outputs.apk-file-size }} | ${{ steps.apk-info-debug.outputs.apk-download-size }} | ${{ steps.apk-info-debug.outputs.apk-download-size-bytes }} |"
} >> $GITHUB_STEP_SUMMARY
checks:
name: Checks & Test
uses: ./.github/workflows/reusable-checks.yml
# Deploy build artefacts to target locations
deploy:
name: Deploy Builds ๐Ÿš€
runs-on: ubuntu-latest
needs: [build, checks]
steps:
- name: Deploy to PlayStore
run: |
{
echo "### Deployment Summary"
echo ""
echo "This Github Action demo is now complete"
echo "Thank you"
echo ""
echo "Enjoy your friday ๐ŸŽ‰"
} >> $GITHUB_STEP_SUMMARY