Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Tlaster committed May 20, 2021
2 parents bed0705 + 3bf124c commit 6122d13
Show file tree
Hide file tree
Showing 186 changed files with 10,567 additions and 881 deletions.
248 changes: 179 additions & 69 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,78 +1,188 @@
name: Android CI

on: [push, pull_request]
on:
push:
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'


jobs:
build:

runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v2

- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 11

- name: Set up Android SDK License
run: yes | /usr/local/lib/android/sdk/tools/bin/sdkmanager --licenses

- name: Build with Gradle
run: ./gradlew spotlessCheck lint build

- name: Upload build reports
uses: actions/upload-artifact@v2
with:
name: build-reports
path: ./app/build/reports

unit-test:
runs-on: ubuntu-latest
needs: build
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2

- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 11

- name: Set up Android SDK License
run: yes | /usr/local/lib/android/sdk/tools/bin/sdkmanager --licenses

- name: Build with Gradle
run: ./gradlew test

- name: Upload test results
if: always()
uses: actions/upload-artifact@v2
with:
name: unit-test-result
path: "**/build/test-results/**/*.xml"

connected-test:
runs-on: macOS-latest
needs: build
timeout-minutes: 60

- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 11

- name: Set up Android SDK License
run: yes | /usr/local/lib/android/sdk/tools/bin/sdkmanager --licenses

- name: Apply Signing
if: ${{ github.event_name != 'pull_request' }}
env:
ALIAS: ${{ secrets.ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
GOOGLE_SERVICES: ${{ secrets.GOOGLE_SERVICES }}
run: ./.github/apply_signing.sh

- name: Build with Gradle
run: ./gradlew spotlessCheck lint bundle assemble --stacktrace

- name: Upload build outputs
uses: actions/upload-artifact@v2
with:
name: build-outputs
path: ./app/build/outputs

- name: Upload build reports
uses: actions/upload-artifact@v2
with:
name: build-reports
path: ./app/build/reports

- name: Check if is prelease
if: startsWith(github.ref, 'refs/tags/')
id: check-tag
run: |
if [[ ${{ github.event.ref }} =~ ^refs/tags/[0-9]+\.[0-9]+\.[0-9]+\-(dev|beta)[0-9]+$ ]]; then
echo ::set-output name=prelease::true
fi
- name: Create Prerelease
if: steps.check-tag.outputs.prelease == 'true'
run: |
set -x
assets=()
for asset in $(find -name *-release.apk); do
assets+=("-a" "$asset")
done
tag_name="${GITHUB_REF##*/}"
hub release create "${assets[@]}" -m "$tag_name" "$tag_name" -p
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create Release
if: steps.check-tag.outputs.prelease != 'true' && startsWith(github.ref, 'refs/tags/')
run: |
set -x
assets=()
for asset in $(find -name *-release.apk); do
assets+=("-a" "$asset")
done
tag_name="${GITHUB_REF##*/}"
hub release create "${assets[@]}" -m "$tag_name" "$tag_name"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
strategy:
# Allow tests to continue on other devices if they fail on one device.
fail-fast: false
matrix:
include:
- api-level: 29
target: default
- api-level: 28
target: default
- api-level: 26
target: default
- api-level: 24
target: default
- api-level: 22
target: default

steps:
- uses: actions/checkout@v2

- name: set up JDK
uses: actions/setup-java@v1
with:
java-version: 11

- name: Set up Android SDK License
run: (while sleep 3; do echo "y"; done) | /Users/runner/Library/Android/sdk/cmdline-tools/latest/bin/sdkmanager --licenses

- name: Build tests
run: ./gradlew assembleAndroidTest

- name: Run tests
uses: reactivecircus/android-emulator-runner@v2
timeout-minutes: 40
with:
api-level: ${{ matrix.api-level }}
profile: 4in WVGA (Nexus S)
target: ${{ matrix.target }}
script: |
adb logcat > logcat.txt &
./gradlew connectedCheck
- name: Upload logs
if: always()
uses: actions/upload-artifact@v2
with:
name: logs-${{ matrix.api-level }}-${{ matrix.target }}
path: logcat.txt

- name: Upload test results
if: always()
uses: actions/upload-artifact@v2
with:
name: test-results-${{ matrix.api-level }}-${{ matrix.target }}
path: "**/build/outputs/**/connected/**/*.xml"

release :
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: [build, unit-test, connected-test]
timeout-minutes: 30

steps:
- uses: actions/checkout@v2

- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 11

- name: Set up Android SDK License
run: yes | /usr/local/lib/android/sdk/tools/bin/sdkmanager --licenses

- name: Apply Signing
env:
ALIAS: ${{ secrets.ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
GOOGLE_SERVICES: ${{ secrets.GOOGLE_SERVICES }}
run: ./.github/apply_signing.sh

- name: Build with Gradle
run: ./gradlew assembleRelease bundleRelease

- name: Check if is prelease
if: startsWith(github.ref, 'refs/tags/')
id: check-tag
run: |
if [[ ${{ github.event.ref }} =~ ^refs/tags/[0-9]+\.[0-9]+\.[0-9]+\-(dev|beta)[0-9]+$ ]]; then
echo ::set-output name=prelease::true
fi
- name: Create Prerelease
if: steps.check-tag.outputs.prelease == 'true'
run: |
set -x
assets=()
for asset in $(find -name *-release.apk); do
assets+=("-a" "$asset")
done
for asset in $(find -name *-release.aab); do
assets+=("-a" "$asset")
done
tag_name="${GITHUB_REF##*/}"
hub release create "${assets[@]}" -m "$tag_name" "$tag_name" -p
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create Release
if: steps.check-tag.outputs.prelease != 'true'
run: |
set -x
assets=()
for asset in $(find -name *-release.apk); do
assets+=("-a" "$asset")
done
for asset in $(find -name *-release.aab); do
assets+=("-a" "$asset")
done
tag_name="${GITHUB_REF##*/}"
hub release create "${assets[@]}" -m "$tag_name" "$tag_name"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 changes: 4 additions & 5 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 25 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,32 @@ Next generation of Twidere for Android 5.0+. **Still in early stage.**


## What's Happening
### 1.1.0 - April 2021 Update
- **Mastodon Support is here!**
- You can now save media for a tweet
- You can now filtering user timeline by reply
- Add clear image and tweet cache support
- UI/UX tweaking
- Stability improve

### What is being planned for 1.1.1 - April 2021

For 1.1.1, we are proactively working on:
- **List Timeline Support!**
- Stability

### 1.2.0 - May 2021 Update

- **Twitter/Mastodon list support is here**
- Link preview is here and suppoted by the data from Twitter/Mastodon server. It's off by default.
- Add placeholder to show loading state and empty state.
- Fix video preview overlay issue #81
- Fix font size slider #66
- UI tweaking for status display
- Upgrade Jetpack Compose to beta06

### What is being planned for 1.3.0 - May 2021
For 1.3.0, we're focusing on stability and UI/UX improve, you can check out our [milestore](https://github.com/TwidereProject/TwidereX-Android/milestone/1) for detail. Here is a short list:

- Twitter/Mastodon thread improve, including reading and sending.
- Notification support (background tasks only).
- Edge to edge support.
- UI/UX tweaking
- Stability

### Roadmap for 2.0 - May 2021
For 2.0, we're considering these options, but it is still an early thought and might change over time.

- Desktop (Linux/Windows) support (by [compose-jb](https://github.com/JetBrains/compose-jb)).
- Javascript extension support.
- View-Only mode (aka Anonymous Browse)

## Contributing

Expand Down
18 changes: 17 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,12 @@ android {

protobuf {
protoc {
artifact = "com.google.protobuf:protoc:${libs.versions.protobuf.get()}"
if (osdetector.os == "osx") {
// TODO: Workaround for Apple M1
artifact = "com.google.protobuf:protoc:${libs.versions.protobuf.get()}:osx-x86_64"
} else {
artifact = "com.google.protobuf:protoc:${libs.versions.protobuf.get()}"
}
}
generateProtoTasks {
all().each { task ->
Expand All @@ -159,6 +164,7 @@ protobuf {

dependencies {
implementation libs.kotlinx.serialization.json
implementation libs.vectordrawable

implementation projects.services
ksp projects.assistedProcessor
Expand All @@ -175,6 +181,11 @@ dependencies {

implementation libs.bundles.room
kapt libs.room.compiler
if (osdetector.os == "osx") {
// TODO: Workaround for Apple M1
// https://issuetracker.google.com/issues/174695268#comment9
kapt "org.xerial:sqlite-jdbc:3.34.0"
}

implementation libs.bundles.lifecycle

Expand All @@ -187,6 +198,7 @@ dependencies {
implementation libs.zoomable
implementation libs.nestedScrollView
implementation libs.swiper
implementation libs.placeholder

implementation libs.twittertext
implementation libs.jsoup
Expand All @@ -207,6 +219,10 @@ dependencies {

testImplementation 'junit:junit:4.13.2'
androidTestImplementation libs.room.testing
testImplementation libs.bundles.mockito.test
testImplementation libs.android.test.core
androidTestImplementation libs.android.test.core
testImplementation libs.kotlinx.coroutines.test
androidTestImplementation libs.bundles.androidx.test
}

Expand Down
Loading

0 comments on commit 6122d13

Please sign in to comment.