Skip to content

Commit

Permalink
upload to Google Play with GitHub Actions, remove Bitrise (#4682)
Browse files Browse the repository at this point in the history
closes #4236

I hope I did everything correctly, we will find out after this is
merged.

I am setting up the environment variables containing the keys so they
are only available to actions that need them.

This should be easier to maintain, GitHub seems to be faster then
Bitrise, and we no longer have two checks on every pull request.
  • Loading branch information
connyduck authored Oct 9, 2024
1 parent 2a4e785 commit a04e95c
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 198 deletions.
13 changes: 3 additions & 10 deletions .github/workflows/ci.yml → .github/workflows/check-and-build.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
name: CI
name: Check and build

on:
push:
tags:
- '*'
pull_request:
workflow_dispatch:
workflow_call:

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -20,14 +16,11 @@ jobs:
java-version: '21'
distribution: 'temurin'

- name: Gradle Wrapper Validation
uses: gradle/actions/wrapper-validation@v4

- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties

- name: Gradle Build Action
uses: gradle/gradle-build-action@v3
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/develop' }}

Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/deploy-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# When a tag is created, create a release build and upload it to Google Play

name: Deploy release to Google Play

on:
push:
tags:
- '*'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: ./.github/workflows/check-and-build.yml

- name: Build Blue aab
run: ./gradlew app:bundleBlueRelease

- uses: r0adkll/sign-android-release@f30bdd30588842ac76044ecdbd4b6d0e3e813478
name: Sign Tusky Blue aab
id: sign_aab
with:
releaseDirectory: app/build/outputs/bundle/blueRelease
signingKeyBase64: ${{ secrets.KEYSTORE }}
alias: ${{ secrets.KEY_ALIAS }}
keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}

- name: Generate whatsnew
id: generate-whatsnew
run: |
mkdir whatsnew
cp $(find fastlane/metadata/android/en-US/changelogs | sort -n -k6 -t/ | tail -n 1) whatsnew/whatsnew-en-US
- name: Upload AAB to Google Play
id: upload-release-asset-aab
uses: r0adkll/[email protected]
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
packageName: com.keylesspalace.tusky
releaseFiles: ${{steps.sign_aab.outputs.signedReleaseFile}}
track: internal
whatsNewDirectory: whatsnew
status: completed
mappingFile: app/build/outputs/mapping/blueGoogleRelease/mapping.txt
45 changes: 45 additions & 0 deletions .github/workflows/deploy-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Deploy Tusky Nightly on each push to develop

name: Deploy Tusky Nightly to Google Play

on:
push:
branches:
- develop

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: ./.github/workflows/check-and-build.yml

- name: Build Green aab
run: ./gradlew app:bundleGreenRelease

- uses: r0adkll/sign-android-release@f30bdd30588842ac76044ecdbd4b6d0e3e813478
name: Sign Tusky Green aab
id: sign_aab
with:
releaseDirectory: app/build/outputs/bundle/greenRelease
signingKeyBase64: ${{ secrets.KEYSTORE }}
alias: ${{ secrets.KEY_ALIAS }}
keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}

- name: Generate whatsnew
id: generate-whatsnew
run: |
mkdir whatsnew
git log -3 --pretty=%B | head -c 500 > whatsnew/whatsnew-en-US
- name: Upload AAB to Google Play
id: upload-release-asset-aab
uses: r0adkll/[email protected]
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
packageName: com.keylesspalace.tusky.test
releaseFiles: ${{steps.sign_aab.outputs.signedReleaseFile}}
track: production
whatsNewDirectory: whatsnew
status: completed
mappingFile: app/build/outputs/mapping/blueGoogleRelease/mapping.txt
34 changes: 0 additions & 34 deletions .github/workflows/populate-gradle-build-cache.yml

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Translate - with Weblate](https://img.shields.io/badge/translate%20with-Weblate-green.svg?style=flat)](https://weblate.tusky.app/) [![OpenCollective](https://opencollective.com/tusky/backers/badge.svg)](https://opencollective.com/tusky/) [![Build Status](https://app.bitrise.io/app/a3e773c3c57a894c/status.svg?token=qLu_Ti4Gp2LWcYT4eo2INQ&branch=develop)](https://app.bitrise.io/app/a3e773c3c57a894c)
[![Translate - with Weblate](https://img.shields.io/badge/translate%20with-Weblate-green.svg?style=flat)](https://weblate.tusky.app/) [![OpenCollective](https://opencollective.com/tusky/backers/badge.svg)](https://opencollective.com/tusky/) [![Build Status](https://github.com/tuskyapp/Tusky/actions/workflows/deploy-test.yml/badge.svg)](https://github.com/tuskyapp/Tusky/actions/workflows/deploy-test.yml)
# Tusky

<img src="/fastlane/metadata/android/en-US/images/icon.png" width="120" height="120"/>
Expand All @@ -15,13 +15,13 @@ Tusky is a beautiful Android client for [Mastodon](https://github.com/mastodon/m
- Multi-Account support
- Dark, light and black themes with the possibility to auto-switch based on the time of day
- Drafts - compose posts and save them for later
- Choose between different emoji styles
- Choose between different emoji styles
- Optimized for all screen sizes
- Completely open-source - no non-free dependencies like Google services

### Testing

The nightly build containing the newest development code is [available on Google Play](https://play.google.com/store/apps/details?id=com.keylesspalace.tusky.test).
The nightly build containing the newest development code is [available on Google Play](https://play.google.com/store/apps/details?id=com.keylesspalace.tusky.test).

### Support

Expand Down
149 changes: 0 additions & 149 deletions bitrise.yml

This file was deleted.

4 changes: 2 additions & 2 deletions doc/Release.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This approach of having ~500 user on the nightly releases and ~5000 users on the
- Tag the head of `main`.
- Create an exhaustive changelog by going through all commits since the last release.
- Mark the release as being a pre-release.
- Bitrise will automatically build and upload the release to the Internal Testing track on Google Play.
- GitHub Actions will automatically build and upload the release to the Internal Testing track on Google Play.
- Do a quick check to make sure the build doesn't crash, e.g. by enrolling yourself into the test track.
- In case there are any problems, delete the GitHub release, fix the problems and start again
- Download the build as apk from Google Play (App Bundle Explorer -> choose the release -> Downloads -> Signed, universal APK). Attach it to the GitHub Release.
Expand All @@ -33,7 +33,7 @@ This approach of having ~500 user on the nightly releases and ~5000 users on the
- Tag the head of `main`.
- Reuse the changelog from the beta release, or create a new one if this is only a minor release.
- (F-Droid will automatically detect and build the release)
- Bitrise will automatically build and upload the release to the Internal Testing track on Google Play.
- GitHub Actions will automatically build and upload the release to the Internal Testing track on Google Play.
- Do a quick check to make sure the build doesn't crash, e.g. by enrolling yourself into the test track.
- In case there are any problems, delete the GitHub release, fix the problems and start again
- Download the build as apk from Google Play (App Bundle Explorer -> choose the release -> Downloads -> Signed, universal APK). Attach it to the GitHub Release.
Expand Down

0 comments on commit a04e95c

Please sign in to comment.