Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upload to Google Play with GitHub Actions, remove Bitrise #4682

Merged
merged 8 commits into from
Oct 9, 2024
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
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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pull_request:
push:
branches:
- develop
pull_request:

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? The action already that runs on develop already includes this action, this would run it twice?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean .github/workflows/populate-gradle-build-cache.yml? It has been deleted in this PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I meant the deploy-test has uses: ./.github/workflows/check-and-build.yml and runs on develop, but it actually doesn't 😅
I'll fix that, thanks

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' }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 }}
Comment on lines +19 to +27
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer it if we don't touch the build.gradle files

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll address that in a separated PR.


- 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