fix(deps): update okhttp to v5.5.0 (#1208) #3165
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Android CI | |
| on: | |
| push: | |
| branches: [ master, develop ] | |
| pull_request: | |
| branches: [ master, develop ] | |
| jobs: | |
| test: | |
| name: Run unit tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: set up JDK 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v6 | |
| with: | |
| cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} | |
| - name: Unit tests | |
| run: bash ./gradlew testDebug --stacktrace | |
| lint: | |
| name: Run lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: set up JDK 21 | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v6 | |
| with: | |
| cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} | |
| - name: Spotless check | |
| run: bash ./gradlew :app:spotlessCheck | |
| - name: Detekt | |
| run: bash ./gradlew :app:detektDebug | |
| - name: Android Lint | |
| run: bash ./gradlew :app:lintDebug | |
| build: | |
| name: Generate apk | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: set up JDK 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v6 | |
| with: | |
| cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} | |
| - name: Build debug apk | |
| run: bash ./gradlew :app:assembleDebug | |
| - name: Upload APK artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: debug apk | |
| path: ${{ github.workspace }}/app/build/outputs/apk/debug/*.apk | |
| - name: Update debug tag | |
| if: (github.event_name == 'push' && github.ref == 'refs/heads/develop') | |
| uses: richardsimko/update-tag@v3.0.0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: debug | |
| - name: Update debug release | |
| if: (github.event_name == 'push' && github.ref == 'refs/heads/develop') | |
| uses: ncipollo/release-action@v1.21.0 | |
| with: | |
| tag: debug | |
| name: Debug APK | |
| artifacts: ${{ github.workspace }}/app/build/outputs/apk/debug/DankChat-debug.apk | |
| allowUpdates: true | |
| build-release: | |
| name: Generate signed release apk | |
| runs-on: ubuntu-latest | |
| environment: release | |
| if: (github.event_name == 'push' && github.ref == 'refs/heads/develop') | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: set up JDK 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v6 | |
| with: | |
| cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} | |
| - name: Decode Keystore | |
| id: decode_keystore | |
| uses: timheuer/base64-to-file@v2.0 | |
| with: | |
| fileName: '/app/keystore/DankChat.jks' | |
| fileDir: ${{ github.workspace }} | |
| encodedString: ${{ secrets.SIGNING_KEY }} | |
| - name: Extract version name | |
| id: version | |
| run: | | |
| base=$(grep 'versionName' app/build.gradle.kts | head -1 | sed 's/.*"\(.*\)".*/\1/') | |
| short_sha="${GITHUB_SHA::7}" | |
| tag="release-v${base}-${short_sha}" | |
| echo "tag=${tag}" >> "$GITHUB_OUTPUT" | |
| echo "name=Release v${base} (${short_sha})" >> "$GITHUB_OUTPUT" | |
| echo "version=${base}" >> "$GITHUB_OUTPUT" | |
| echo "short_sha=${short_sha}" >> "$GITHUB_OUTPUT" | |
| - name: Build signed release apk | |
| run: bash ./gradlew app:assembleRelease | |
| env: | |
| SIGNING_KEY_ALIAS: ${{ secrets.KEY_ALIAS }} | |
| SIGNING_KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
| SIGNING_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }} | |
| - name: Upload APK artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: Signed release apk | |
| path: ${{ github.workspace }}/app/build/outputs/apk/release/*.apk | |
| - name: Update rolling release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| TAG: ${{ steps.version.outputs.tag }} | |
| RELEASE_NAME: ${{ steps.version.outputs.name }} | |
| VERSION: ${{ steps.version.outputs.version }} | |
| SHORT_SHA: ${{ steps.version.outputs.short_sha }} | |
| REPO: ${{ github.repository }} | |
| run: | | |
| apk=$(ls ${{ github.workspace }}/app/build/outputs/apk/release/*.apk | head -1) | |
| if ! git ls-remote --exit-code --tags origin "$TAG" >/dev/null 2>&1; then | |
| git tag "$TAG" | |
| git push origin "$TAG" | |
| fi | |
| release_id=$(gh api "repos/$REPO/releases" \ | |
| --jq '.[] | select(.name | startswith("Release")) | .id' | head -1) | |
| notes="**Version:** \`v${VERSION}\` | |
| **Commit:** [\`${SHORT_SHA}\`](https://github.com/${REPO}/commit/${GITHUB_SHA})" | |
| # GitHub displays the original publish date, so the release is recreated on every build | |
| if [ -n "$release_id" ]; then | |
| old_tag=$(gh api "repos/$REPO/releases/$release_id" --jq '.tag_name') | |
| gh api -X DELETE "repos/$REPO/releases/$release_id" | |
| if [ "$old_tag" != "$TAG" ]; then | |
| git push origin ":refs/tags/$old_tag" || true | |
| fi | |
| fi | |
| gh release create "$TAG" "$apk" \ | |
| --repo "$REPO" \ | |
| --title "$RELEASE_NAME" \ | |
| --notes "$notes" \ | |
| --latest |