Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
## Setting up workflows
## Setting Up Workflows

### 1. Following secrets are needed by implemented workflows. All of them are available
in organization level secrets, you just have to grant access to particular app:
Predefined workflows use shared configurations from the [Futured .github repository](https://github.com/futuredapp/.github).

1. `DANGER_GITHUB_API_TOKEN`
2. `SLACK_WEB_HOOK`
3. `APPCENTER_API_TOKEN`
### Adjusting Workflows
If you need modifications, such as adding new environment variables, consider the following approaches:

1. **Suggest Improvements to Shared Workflows**
If the change could benefit multiple projects, propose an update to the shared workflows.

2. **Customize for Your Project**
If the change is project-specific, copy the shared workflow into your repository and modify it accordingly.

### 2. Configure workflow .yml files

For each workflow configuration file, configure all environment variables marked with `TODO` comment.

For more details, visit the [Futured .github repository](https://github.com/futuredapp/.github) and [Futured Engineering Handbook](https://github.com/futuredapp/Engineering-Handbook).
69 changes: 22 additions & 47 deletions .github/workflows/enterprise.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,28 @@
name: Enterprise build

on:
push:
branches: [develop]
branches:
- develop

concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true

jobs:
enterprise:
name: Enterprise build
runs-on: [ubuntu-latest]
env:
deploy_enterprise:
name: Deploy enterprise build
uses: futuredapp/.github/.github/workflows/android-cloud-release-firebaseAppDistribution.yml@main
with:
TEST_GRADLE_TASKS: testDevEnterpriseUnitTest
BUNDLE_GRADLE_TASK: bundleDevEnterprise
UPLOAD_GRADLE_TASK: appDistributionUploadDevEnterprise
SIGNING_KEYSTORE_PATH: keystore/debug.jks
# TODO Verify app distribution groups
APP_DISTRIBUTION_GROUPS: futured-qa, devs
APP_DISTRIBUTION_ARTIFACT_TYPE: APK
FIREBASE_CREDENTIALS_FILE: firebase_credentials.json
# TODO Platform-specific slack channel name for notifications, eg. "gmlh-android"
SLACK_CHANNEL: project-slack-channel-name
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
- name: Set up JDK
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '17'
- name: Prepare environment
run: |
echo "BUILD_NUMBER=$((GITHUB_RUN_NUMBER))" >> $GITHUB_ENV
echo '${{ secrets.APP_DISTRIBUTION_SERVICE_ACCOUNT }}' > $FIREBASE_CREDENTIALS_FILE
- name: Run unit tests
shell: bash
run: ./gradlew --continue testDevEnterpriseUnitTest
- name: Assemble and upload to Firebase App Distribution
shell: bash
run: |
./gradlew \
assembleDevEnterprise \
appDistributionUploadDevEnterprise \
--serviceCredentialsFile="$FIREBASE_CREDENTIALS_FILE" \
--artifactType="$APP_DISTRIBUTION_ARTIFACT_TYPE" \
--groups="$APP_DISTRIBUTION_GROUPS"
- name: Slack Notification
if: failure()
uses: homoluctus/slatify@master
with:
type: "failure"
job_name: '*Enterprise build*'
username: GitHub
channel: ${{env.SLACK_CHANNEL}}
url: ${{secrets.SLACK_WEB_HOOK}}
commit: true
token: ${{secrets.GITHUB_TOKEN}}
APP_DISTRIBUTION_GROUPS: futured-devs, futured-qa
secrets:
# TODO Set up `APP_DISTRIBUTION_SERVICE_ACCOUNT` as plaintext JSON for this GitHub repository
SIGNING_KEYSTORE_PASSWORD: android
SIGNING_KEY_ALIAS: androiddebugkey
SIGNING_KEY_PASSWORD: android
APP_DISTRIBUTION_SERVICE_ACCOUNT: ${{ secrets.APP_DISTRIBUTION_SERVICE_ACCOUNT }}
56 changes: 12 additions & 44 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,14 @@
name: Check PR
on: [pull_request]
name: Check Pull request

on: [ pull_request ]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

jobs:
pr:
name: PR check
runs-on: [ubuntu-latest]
env:
# TODO Platform-specific slack channel name for notifications, eg. "gmlh-android"
SLACK_CHANNEL: project-slack-channel-name
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
- name: Set up JDK
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '17'
- name: Run LintCheck
shell: bash
run: ./gradlew lintCheck
- name: Run unit tests
shell: bash
run: ./gradlew --continue testDevEnterpriseUnitTest
- name: Danger action
uses: MeilCli/danger-action@v2
continue-on-error: true
with:
plugins_file: 'Gemfile'
danger_file: 'Dangerfile'
danger_id: 'danger-pr'
env:
DANGER_GITHUB_API_TOKEN: ${{ secrets.DANGER_GITHUB_API_TOKEN }}
- name: Slack Notification
if: failure()
uses: homoluctus/slatify@master
with:
type: "failure"
job_name: '*PR Check*'
username: GitHub
channel: ${{env.SLACK_CHANNEL}}
url: ${{ secrets.SLACK_WEB_HOOK }}
commit: true
token: ${{ secrets.GITHUB_TOKEN }}
check:
uses: futuredapp/.github/.github/workflows/android-cloud-check.yml@main
with:
LINT_GRADLE_TASKS: lintCheck
TEST_GRADLE_TASKS: testDevEnterpriseUnitTest
86 changes: 23 additions & 63 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,69 +2,29 @@ name: Release build

on:
release:
types: [published]
types: [ published ]

concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true

jobs:
release:
name: Release build
runs-on: [ubuntu-latest]
env:
EXCLUDE_AAB_FILTER: .*intermediate
# TODO Platform-specific slack channel name for notifications, eg. "gmlh-android"
SLACK_CHANNEL: project-slack-channel-name
deploy_release:
name: Deploy release build
uses: futuredapp/.github/.github/workflows/android-cloud-release-googlePlay.yml@main
with:
VERSION_NAME: ${{ github.event.release.tag_name }}
steps:
- name: Set build number
run: echo "BUILD_NUMBER=$((GITHUB_RUN_NUMBER))" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
- name: Run unit tests
shell: bash
run: ./gradlew --continue testDevEnterpriseUnitTest
- name: Generate app bundle
shell: bash
env:
# TODO Set up `RELEASE_KEYSTORE_PASSWORD` secret for this GitHub repository
# TODO Set up `RELEASE_KEY_PASSWORD` secret for this GitHub repository
# TODO Set up `RELEASE_KEY_ALIAS` secret for this GitHub repository
RELEASE_KEYSTORE_PASS: ${{ secrets.RELEASE_KEYSTORE_PASSWORD }}
RELEASE_KEY_PASS: ${{ secrets.RELEASE_KEY_PASSWORD }}
RELEASE_KEY_ALIAS: ${{ secrets.RELEASE_KEY_ALIAS }}
run: ./gradlew bundleProdRelease
- name: Find artifacts and mapping file
shell: bash
run: |
echo ::set-output name=aab_file::$(find . -name "*.aab" | grep -v ${{env.EXCLUDE_AAB_FILTER}})
echo ::set-output name=mapping_file::$(find . -name mapping.txt)
id: artifacts
- name: Upload Android Release to Play Store
uses: r0adkll/upload-google-play@v1
with:
# TODO Set up `GOOGLE_PLAY_PUBLISH_SERVICE_ACCOUNT` as plaintext JSON for this GitHub repository
serviceAccountJsonPlainText: ${{ secrets.GOOGLE_PLAY_PUBLISH_SERVICE_ACCOUNT }}
# TODO This has to be applicationId
packageName: app.futured.androidprojecttemplate
releaseFiles: ${{ steps.artifacts.outputs.aab_file }}
track: internal
status: draft
whatsNewDirectory: whatsnew
mappingFile: ${{ steps.artifacts.outputs.mapping_file }}
- name: Slack Notification
if: failure()
uses: homoluctus/slatify@master
with:
type: "failure"
job_name: '*Release build*'
username: GitHub
channel: ${{env.SLACK_CHANNEL}}
url: ${{secrets.SLACK_WEB_HOOK}}
commit: true
token: ${{secrets.GITHUB_TOKEN}}
BUNDLE_GRADLE_TASK: bundleProdRelease
SIGNING_KEYSTORE_PATH: keystore/release.jks
# TODO This has to be applicationId
GOOGLE_PLAY_APPLICATION_ID: app.futured.androidprojecttemplate
GOOGLE_PLAY_WHATSNEW_DIRECTORY: whatsnew
secrets:
# TODO Set up `RELEASE_KEYSTORE_PASSWORD` secret for this GitHub repository
# TODO Set up `RELEASE_KEY_PASSWORD` secret for this GitHub repository
# TODO Set up `RELEASE_KEY_ALIAS` secret for this GitHub repository
# TODO Set up `GOOGLE_PLAY_PUBLISH_SERVICE_ACCOUNT` as plaintext JSON for this GitHub repository
SIGNING_KEYSTORE_PASSWORD: ${{ secrets.RELEASE_KEYSTORE_PASSWORD }}
SIGNING_KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }}
SIGNING_KEY_ALIAS: ${{ secrets.RELEASE_KEY_ALIAS }}
GOOGLE_PLAY_PUBLISH_SERVICE_ACCOUNT: ${{ secrets.GOOGLE_PLAY_PUBLISH_SERVICE_ACCOUNT }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ~~Project name~~ (Android)

![minSdk](https://img.shields.io/badge/minSdk-21-brightgreen.svg?style=flat) ![targetSdk](https://img.shields.io/badge/targetSdk-34-brightgreen.svg?style=flat) ![Bitrise](https://img.shields.io/bitrise/appid.svg?token=apptoken)
![minSdk](https://img.shields.io/badge/minSdk-29-brightgreen.svg?style=flat) ![targetSdk](https://img.shields.io/badge/targetSdk-34-brightgreen.svg?style=flat) ![Bitrise](https://img.shields.io/bitrise/appid.svg?token=apptoken)


~~Short project description.~~
Expand Down
10 changes: 5 additions & 5 deletions buildSrc/src/main/kotlin/ProjectSettings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ object ProjectSettings {
const val compileSdkVersion = 34
const val targetSdk = 34
const val minSdk = 29
val versionName = System.getenv("VERSION_NAME") ?: "1.0.0"
val versionCode = System.getenv("BUILD_NUMBER")?.toInt() ?: 1
val versionName = System.getenv("ANDROID_VERSION_NAME") ?: "1.0.0"
val versionCode = System.getenv("ANDROID_BUILD_NUMBER")?.toInt() ?: 1

object Flavor {
const val DIMENSION = "api"
Expand All @@ -27,9 +27,9 @@ object ProjectSettings {
}

object Release {
const val KEY_ALIAS = "TBD"
val KEY_PASSWORD = System.getenv("KEY_PASSWORD") ?: ""
val STORE_PASSWORD = System.getenv("STORE_PASSWORD") ?: ""
val KEY_ALIAS = System.getenv("ANDROID_KEY_ALIAS") ?: ""
val KEY_PASSWORD = System.getenv("ANDROID_KEY_PASSWORD") ?: ""
val STORE_PASSWORD = System.getenv("ANDROID_KEYSTORE_PASSWORD") ?: ""
}

const val TASK_GROUP = "futured"
Expand Down
Loading