Skip to content

feat: Add general contributing infos #45

feat: Add general contributing infos

feat: Add general contributing infos #45

Workflow file for this run

name: Build APKs
on:
workflow_dispatch:
merge_group:
push:
branches: [ master ]
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
env:
CI_GRADLE_ARG_PROPERTIES: "--stacktrace"
permissions: {}
jobs:
build:
name: Build APKs
runs-on: ubuntu-latest
strategy:
matrix:
variant: [ debug, release ]
fail-fast: false
concurrency:
group: ${{ github.ref == 'refs/heads/master' && format('build-master-{0}-{1}', matrix.variant, github.sha) || format('build-{0}-{1}', matrix.variant, github.ref) }}
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
# See: https://github.com/actions/checkout/issues/881
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }}
persist-credentials: false
- name: Configure JDK
uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '21'
- name: Configure Gradle
uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0
with:
cache-read-only: ${{ github.ref != 'refs/heads/master' }}
- name: Export AboutLibraries library definitions
# Used to run only once
if: matrix.variant == 'debug'
run: ./gradlew :app:exportLibraryDefinitions --dependency-verification lenient --continue $CI_GRADLE_ARG_PROPERTIES
- name: Assemble debug APKs
id: projectkafka-build
if: matrix.variant == 'debug'
run: ./gradlew :app:assembleDebug $CI_GRADLE_ARG_PROPERTIES
- name: Upload debug APKs
id: projectkafka-upload
if: matrix.variant == 'debug'
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: projectkafka-debug
path: |
app/build/outputs/apk/debug/*-debug.apk
- name: Create app token for PR comments
if: matrix.variant == 'debug' && github.event_name == 'pull_request' && steps.projectkafka-upload.conclusion == 'success' && github.repository == github.event.pull_request.head.repo.full_name
uses: actions/create-github-app-token@7e473efe3cb98aa54f8d4bac15400b15fad77d94 # v2.2.0
id: app-token
with:
app-id: ${{ vars.HANEKOKORO_BOT_APP_ID }}
private-key: ${{ secrets.HANEKOKORO_BOT_PRIVATE_KEY }}
- name: Comment on PR for artifacts link
if: matrix.variant == 'debug' && github.event_name == 'pull_request' && steps.projectkafka-upload.conclusion == 'success' && github.repository == github.event.pull_request.head.repo.full_name
uses: NejcZdovc/comment-pr@a423635d183a8259308e80593c96fecf31539c26 # v2.1.0
with:
message: |
**Download Debug Artifacts**: [projectkafka-debug.zip](https://nightly.link/ShadowRZ/ProjectKafka/actions/artifacts/${{ steps.projectkafka-upload.outputs.artifact-id }}.zip)
# Enables to identify and update existing Ad-hoc release message on new commit in the PR
identifier: "PROJECTKAFKA_COMMENT_ARTIFACTS"
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
- name: Compile release sources
if: ${{ matrix.variant == 'release' }}
run: ./gradlew :app:assembleRelease $CI_GRADLE_ARG_PROPERTIES