-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Flattens the commit history in preparation of making this repo public. The code in this repo has been written by: @stoyicker, @kgrevehagen, @mariusgreve, @michpohl, @paulinaaniola, @sula-sa and @ziad-halabi9. Co-authored-by: Jorge Antonio Diaz-Benito Soriano <[email protected]> Co-authored-by: Kristian Greve Hagen <[email protected]> Co-authored-by: Marius Greve Hagen <[email protected]> Co-authored-by: Michael Pohl <[email protected]> Co-authored-by: Paulina Aniola <[email protected]> Co-authored-by: Sultan Seidalin <[email protected]> Co-authored-by: Ziad Al Halabi <[email protected]> on-behalf-of: @tidal-music <[email protected]>
- Loading branch information
Showing
807 changed files
with
43,941 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
root=true | ||
|
||
[*.{kt,kts}] | ||
end_of_line=lf | ||
insert_final_newline=true | ||
charset=utf-8 | ||
trim_trailing_whitespace=true | ||
max_line_length=100 | ||
|
||
ij_continuation_indent_size=4 | ||
ij_kotlin_keep_blank_lines_before_right_brace=0 | ||
ij_kotlin_keep_blank_lines_in_code=1 | ||
ij_kotlin_keep_blank_lines_in_declarations=1 | ||
ij_kotlin_name_count_to_use_star_import=10000 | ||
ij_kotlin_name_count_to_use_star_import_for_members=10000 | ||
ij_kotlin_allow_trailing_comma_on_call_site=true | ||
ij_kotlin_allow_trailing_comma=true | ||
|
||
ktlint_code_style=android_studio | ||
ktlint_standard_trailing-comma-on-call-site=disabled | ||
ktlint_standard_function-naming=disabled | ||
ktlint_standard_function-signature=disabled | ||
ktlint_function_signature_wrapping_rule_always_with_minimum_parameters=3 | ||
|
||
[*Test.kt] | ||
ktlint_standard_max-line-length=disabled | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: 3 | ||
|
||
targets: | ||
only: | ||
- type: gradle | ||
path: . |
Validating CODEOWNERS rules …
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/player/ @tidal-music/pace-android |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env kotlin | ||
|
||
@file:DependsOn("com.fasterxml.jackson.module:jackson-module-kotlin:2.17.0") | ||
|
||
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper | ||
import com.fasterxml.jackson.module.kotlin.readValue | ||
import java.io.File | ||
|
||
data class Module(val name: String, val version: String) | ||
|
||
val modulesWithVersionsJson = args[0] | ||
|
||
val modules: List<Module> = jacksonObjectMapper().readValue(modulesWithVersionsJson) | ||
|
||
for (module in modules) { | ||
val moduleName = module.name | ||
val version = module.version | ||
val pattern = Regex("## \\[$version\\]") | ||
val changelogContent = File("./$moduleName/CHANGELOG.md").readText() | ||
if (pattern.containsMatchIn(changelogContent)) { | ||
println("✅ Version string $version found in CHANGELOG.md for module $moduleName") | ||
} else { | ||
println("⛔️ String $version not found in CHANGELOG.md for module $moduleName") | ||
System.exit(1) | ||
} | ||
} | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Check version bump and changelog files | ||
|
||
on: | ||
workflow_call | ||
|
||
jobs: | ||
check-version-bump: | ||
runs-on: ubuntu-latest | ||
name: Verify whether any updates were made to the modules' versions, and if they were, examine the changelog files for the respective modules | ||
steps: | ||
- uses: actions/setup-java@v4 | ||
with: | ||
java-version: 17 | ||
distribution: temurin | ||
- run: mkdir workspace && cd workspace | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.base_ref }} | ||
- uses: gradle/wrapper-validation-action@b231772637bb498f11fdbc86052b6e8a8dc9fc92 | ||
- name: Get base versions | ||
run: | | ||
for module in $(./gradlew -q --console=plain printSdkModules); do | ||
./gradlew $module:properties | grep "^version: " | awk '{print $2}' > ../$module.base.version | ||
done | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ env.GITHUB_REF }} | ||
- name: Get HEAD versions | ||
run: | | ||
for module in $(./gradlew -q --console=plain printSdkModules); do | ||
./gradlew $module:properties | grep "^version: " | awk '{print $2}' > ../$module.head.version | ||
done | ||
- name: Get modules which version has been increased comparing to the target branch | ||
id: get-modules-with-increased-version | ||
run: | | ||
set +e | ||
module_list=() | ||
for module in $(./gradlew -q --console=plain printSdkModules); do | ||
VERSION_FILE_HEAD=../$module.head.version | ||
if [ ! -f "$VERSION_FILE_HEAD" ]; then | ||
continue | ||
fi | ||
if cmp -s ../$module.base.version $VERSION_FILE_HEAD; then | ||
continue | ||
fi | ||
head_version=$(cat $VERSION_FILE_HEAD) | ||
module_list+=("{\"name\": \"$module\", \"version\": \"$head_version\"}") | ||
done | ||
jsonString="$(jq --compact-output --null-input '$ARGS.positional' --args -- "${module_list[@]}")" | ||
echo "modules=$jsonString" >> $GITHUB_OUTPUT | ||
- name: Check changelog files | ||
if: ${{ steps.get-modules-with-increased-version.outputs.modules != '' }} | ||
run: | | ||
kotlinc -script .github/scripts/CheckChangelogs.main.kts ${{ steps.get-modules-with-increased-version.outputs.modules}} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Create release | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
module: | ||
required: true | ||
type: string | ||
secrets: | ||
pat: | ||
required: true | ||
|
||
jobs: | ||
expose-tag: | ||
name: Expose Tag | ||
runs-on: ubuntu-latest | ||
env: | ||
ORG_GRADLE_PROJECT_githubToken: ${{ secrets.pat }} | ||
outputs: | ||
module-tag: ${{ steps.expose-tag.outputs.tag }} | ||
module-version: ${{ steps.expose-tag.outputs.version }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
java-version: 17 | ||
distribution: temurin | ||
- name: Expose tag and version | ||
id: expose-tag | ||
run: | | ||
version="$(./gradlew ${{ inputs.module }}:properties | grep "^version: " | awk '{print $2}')" | ||
tag="${{ inputs.module }}-$version" | ||
echo "version=$version" >> $GITHUB_OUTPUT | ||
echo "tag=$tag" >> $GITHUB_OUTPUT | ||
create-release: | ||
runs-on: ubuntu-latest | ||
needs: [ expose-tag ] | ||
permissions: | ||
contents: write | ||
env: | ||
name: ${{ inputs.module}} | ||
version: ${{ needs.expose-tag.outputs.module-version}} | ||
tag: ${{ needs.expose-tag.outputs.module-tag}} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
java-version: 17 | ||
distribution: temurin | ||
|
||
- name: Generate Release Draft | ||
id: generate-release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
tag: ${{ env.tag }} | ||
allowUpdates: true | ||
draft: true | ||
body: "This is a release draft for ${{ env.tag }}" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: FOSSA Scans | ||
|
||
on: | ||
workflow_call: | ||
secrets: | ||
pat: | ||
required: true | ||
fossaApiKey: | ||
required: true | ||
env: | ||
ORG_GRADLE_PROJECT_githubToken: ${{ secrets.pat }} | ||
|
||
jobs: | ||
fossa-scan: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: gradle/gradle-build-action@v3 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
java-version: 17 | ||
distribution: temurin | ||
|
||
- name: "Run FOSSA Scan" | ||
uses: fossas/[email protected] | ||
with: | ||
api-key: ${{secrets.fossaApiKey}} | ||
|
||
- name: "Run FOSSA Tests" | ||
uses: fossas/[email protected] | ||
with: | ||
api-key: ${{secrets.fossaApiKey}} | ||
run-tests: true |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Instrumented Tests | ||
|
||
on: | ||
workflow_call: | ||
secrets: | ||
pat: | ||
required: true | ||
|
||
jobs: | ||
run-instrumented-tests: | ||
runs-on: ubuntu-latest | ||
env: | ||
ORG_GRADLE_PROJECT_githubToken: ${{ secrets.pat }} | ||
name: Run instrumented tests | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Enable KVM group perms | ||
run: | | ||
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | ||
sudo udevadm control --reload-rules | ||
sudo udevadm trigger --name-match=kvm | ||
- uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
- name: Validate Gradle wrapper | ||
uses: gradle/wrapper-validation-action@b231772637bb498f11fdbc86052b6e8a8dc9fc92 | ||
- uses: reactivecircus/[email protected] | ||
with: | ||
api-level: 29 | ||
script: ./gradlew -Dorg.gradle.logging.level=quiet connectedCheck |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Run lint checks | ||
|
||
on: | ||
workflow_call: | ||
secrets: | ||
pat: | ||
required: true | ||
|
||
env: | ||
ORG_GRADLE_PROJECT_githubToken: ${{ secrets.pat }} | ||
|
||
jobs: | ||
run-ktlint: | ||
runs-on: ubuntu-latest | ||
name: Run ktlint | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Run ktlint | ||
run: static-analysis/run-ktlint.sh | ||
|
||
run-detekt: | ||
runs-on: ubuntu-latest | ||
name: Run detekt | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: 17 | ||
distribution: temurin | ||
|
||
- name: Run detekt | ||
run: static-analysis/run-detekt.sh | ||
|
||
run-lint: | ||
runs-on: ubuntu-latest | ||
name: Run lint | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: 17 | ||
distribution: temurin | ||
|
||
- name: Run lint | ||
run: ./gradlew lint | ||
|
||
- name: Print lint report(s) | ||
if: ${{ failure() }} | ||
run: cat **/build/reports/lint-results-*.xml |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: Post-Merge | ||
on: | ||
push: | ||
branches: 'main' | ||
|
||
concurrency: | ||
group: ${{ github.workflow_ref }}-${{ github.ref }} | ||
|
||
jobs: | ||
|
||
build-module-list: | ||
runs-on: ubuntu-latest | ||
name: Generate candidate SDK module list | ||
outputs: | ||
modules: ${{ steps.build-matrix.outputs.modules}} | ||
env: | ||
REF_BEFORE: ${{ github.event.before }} | ||
ORG_GRADLE_PROJECT_githubToken: ${{ secrets.pat }} | ||
steps: | ||
- uses: actions/setup-java@v4 | ||
with: | ||
java-version: 17 | ||
distribution: temurin | ||
- run: mkdir workspace && cd workspace | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ env.REF_BEFORE }} | ||
- uses: gradle/wrapper-validation-action@b231772637bb498f11fdbc86052b6e8a8dc9fc92 | ||
- name: Get base versions | ||
run: | | ||
for module in $(./gradlew -q --console=plain printSdkModules); do | ||
./gradlew $module:properties | grep "^version: " | awk '{print $2}' > ../$module.base.version | ||
done | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ env.GITHUB_REF }} | ||
- name: Get HEAD versions | ||
run: | | ||
for module in $(./gradlew -q --console=plain printSdkModules); do | ||
./gradlew $module:properties | grep "^version: " | awk '{print $2}' > ../$module.head.version | ||
done | ||
- name: Build matrix input | ||
id: build-matrix | ||
run: | | ||
set +e | ||
module_list=() | ||
for module in $(./gradlew -q --console=plain printSdkModules); do | ||
VERSION_FILE_HEAD=../$module.head.version | ||
if [ ! -f "$VERSION_FILE_HEAD" ]; then | ||
continue | ||
fi | ||
if cmp -s ../$module.base.version $VERSION_FILE_HEAD; then | ||
continue | ||
fi | ||
module_list+=("$module") | ||
done | ||
jsonString="$(jq --compact-output --null-input '$ARGS.positional' --args -- "${module_list[@]}")" | ||
echo "modules=$jsonString" >> $GITHUB_OUTPUT | ||
trigger-releases: | ||
name: Trigger releases | ||
needs: [ build-module-list ] | ||
if: ${{ needs.build-module-list.outputs.modules != '' && toJson(fromJson(needs.build-module-list.outputs.modules)) != '[]' }} | ||
permissions: write-all | ||
strategy: | ||
matrix: | ||
module: ${{ fromJSON(needs.build-module-list.outputs.modules) }} | ||
uses: ./.github/workflows/create-release.yml | ||
with: | ||
module: ${{ matrix.module }} | ||
secrets: | ||
pat: ${{ secrets.PACKAGES_PAT }} |
Oops, something went wrong.