diff --git a/.github/workflows/build_windows.yml b/.github/workflows/build_windows.yml index a26017251..bf5cefe95 100644 --- a/.github/workflows/build_windows.yml +++ b/.github/workflows/build_windows.yml @@ -18,11 +18,21 @@ jobs: USERNAME: ${{ github.actor }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v4 - - name: Set up JDK 17 + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Java uses: actions/setup-java@v4 with: java-version: '17' distribution: 'temurin' + - name: Set up Gradle + uses: gradle/actions/setup-gradle@v4 + with: + cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }} + cache-read-only: true - name: Build project - run: ./gradlew :pillarbox-demo:assembleProdDebug :pillarbox-demo-tv:assembleDebug + run: > + ./gradlew + :pillarbox-demo:assembleProdDebug + :pillarbox-demo-cast:assembleDebug + :pillarbox-demo-tv:assembleDebug diff --git a/.github/workflows/dependency_graph.yml b/.github/workflows/dependency_graph.yml index 04e8609bf..3669ac53f 100644 --- a/.github/workflows/dependency_graph.yml +++ b/.github/workflows/dependency_graph.yml @@ -19,8 +19,9 @@ jobs: USERNAME: ${{ github.actor }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v4 - - name: Set up JDK 17 + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Java uses: actions/setup-java@v4 with: java-version: '17' diff --git a/.github/workflows/deploy_dokka_documentation.yml b/.github/workflows/deploy_dokka_documentation.yml deleted file mode 100644 index 042c5085c..000000000 --- a/.github/workflows/deploy_dokka_documentation.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Deploy Dokka documentation - -on: - push: - branches: - - main - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - contents: write - -jobs: - deploy-dokka-documentation: - name: Deploy Dokka documentation - runs-on: ubuntu-latest - env: - USERNAME: ${{ github.actor }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@v4 - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' - - uses: gradle/actions/setup-gradle@v4 - with: - cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }} - - name: Build Dokka documentation - run: ./gradlew :dokkaGenerate - - name: Deploy Dokka documentation - uses: JamesIves/github-pages-deploy-action@v4 - with: - branch: gh-pages - folder: build/dokka/html - single-commit: true - target-folder: api diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 2d5cab2c4..87b15e61a 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -13,14 +13,15 @@ on: - cron: '0 0 * * *' jobs: - check_date: + check-date: runs-on: ubuntu-latest name: Check latest commit outputs: should_run: ${{ steps.should_run.outputs.should_run }} steps: - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 - id: should_run name: Check that the last commit was made in the last 24h if: ${{ github.event_name == 'schedule' }} @@ -32,9 +33,9 @@ jobs: echo "should_run=false" >> "$GITHUB_OUTPUT" fi - Build-nightly: - needs: check_date - if: ${{ needs.check_date.outputs.should_run != 'false' }} + build-nightly: + needs: check-date + if: ${{ needs.check-date.outputs.should_run != 'false' }} runs-on: ubuntu-latest env: DEMO_KEY_PASSWORD: ${{ secrets.DEMO_KEY_PASSWORD }} @@ -42,7 +43,8 @@ jobs: GITHUB_TOKEN: ${{ github.token }} steps: - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 with: fetch-depth: 0 # Required due to the way Git works, without it this action won't be able to find any or the correct tags - name: Setup VERSION_NAME from inputs @@ -57,21 +59,23 @@ jobs: - name: Setup VERSION_NAME from the latest tag if: ${{ github.event_name != 'workflow_dispatch' }} run: echo "VERSION_NAME=${{ steps.previoustag.outputs.tag }}" >> "$GITHUB_ENV" - - name: Print VersionName + - name: Print version information run: | - echo "Version name is ${{ env.VERSION_NAME }}" - echo "GitHub ref ${GITHUB_REF}" - echo "GitHub ref name ${GITHUB_REF_NAME}" - echo "GitHub ref type ${GITHUB_REF_TYPE}" - echo "CI ${{ env.CI }}" - - name: Set up JDK 17 + echo "Version name: ${{ env.VERSION_NAME }}" + echo "GitHub ref: ${GITHUB_REF}" + echo "GitHub ref name: ${GITHUB_REF_NAME}" + echo "GitHub ref type: ${GITHUB_REF_TYPE}" + echo "CI: ${{ env.CI }}" + - name: Set up Java uses: actions/setup-java@v4 with: java-version: '17' distribution: 'temurin' - - uses: gradle/actions/setup-gradle@v4 + - name: Set up Gradle + uses: gradle/actions/setup-gradle@v4 with: cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }} + cache-read-only: true - name: Assemble nightly release run: ./gradlew assembleNightlyRelease - name: Upload artifact to Firebase App Distribution diff --git a/.github/workflows/build.yml b/.github/workflows/quality.yml similarity index 75% rename from .github/workflows/build.yml rename to .github/workflows/quality.yml index 38167b9af..2ec967a45 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/quality.yml @@ -1,4 +1,4 @@ -name: Build +name: Quality on: merge_group: @@ -6,7 +6,6 @@ on: branches: - main pull_request: - types: [ synchronize, opened, reopened, ready_for_review ] concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -20,17 +19,24 @@ jobs: USERNAME: ${{ github.actor }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v4 - - name: Set up JDK 17 + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Java uses: actions/setup-java@v4 with: java-version: '17' distribution: 'temurin' - - uses: gradle/actions/setup-gradle@v4 + - name: Set up Gradle + uses: gradle/actions/setup-gradle@v4 with: cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }} - name: Build modules - run: ./gradlew :pillarbox-demo:assembleProdDebug :pillarbox-demo-cast:assembleDebug :pillarbox-demo-tv:assembleDebug :pillarbox-player-testutils:assembleDebug + run: > + ./gradlew + :pillarbox-demo:assembleProdDebug + :pillarbox-demo-cast:assembleDebug + :pillarbox-demo-tv:assembleDebug + :pillarbox-player-testutils:assembleDebug android-lint: name: Android Lint @@ -40,18 +46,26 @@ jobs: USERNAME: ${{ github.actor }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v4 - - name: Set up JDK 17 + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Java uses: actions/setup-java@v4 with: java-version: '17' distribution: 'temurin' - - uses: gradle/actions/setup-gradle@v4 + - name: Set up Gradle + uses: gradle/actions/setup-gradle@v4 with: cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }} - name: Run Android Lint - run: ./gradlew :pillarbox-demo:lintProdDebug :pillarbox-demo-cast:lintDebug :pillarbox-demo-tv:lintDebug :pillarbox-player-testutils:lintDebug - - uses: github/codeql-action/upload-sarif@v3 + run: > + ./gradlew + :pillarbox-demo:lintProdDebug + :pillarbox-demo-cast:lintDebug + :pillarbox-demo-tv:lintDebug + :pillarbox-player-testutils:lintDebug + - name: Upload Android Lint results + uses: github/codeql-action/upload-sarif@v3 if: success() || failure() with: sarif_file: build/reports/android-lint/ @@ -65,18 +79,21 @@ jobs: USERNAME: ${{ github.actor }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v4 - - name: Set up JDK 17 + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Java uses: actions/setup-java@v4 with: java-version: '17' distribution: 'temurin' - - uses: gradle/actions/setup-gradle@v4 + - name: Set up Gradle + uses: gradle/actions/setup-gradle@v4 with: cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }} - name: Run Detekt run: ./gradlew detekt - - uses: github/codeql-action/upload-sarif@v3 + - name: Upload Detekt results + uses: github/codeql-action/upload-sarif@v3 if: success() || failure() with: sarif_file: build/reports/detekt/ @@ -90,13 +107,15 @@ jobs: USERNAME: ${{ github.actor }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v4 - - name: Set up JDK 17 + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Java uses: actions/setup-java@v4 with: java-version: '17' distribution: 'temurin' - - uses: gradle/actions/setup-gradle@v4 + - name: Set up Gradle + uses: gradle/actions/setup-gradle@v4 with: cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }} - name: Run Dependency Analysis @@ -112,13 +131,15 @@ jobs: USERNAME: ${{ github.actor }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v4 - - name: Set up JDK 17 + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Java uses: actions/setup-java@v4 with: java-version: '17' distribution: 'temurin' - - uses: gradle/actions/setup-gradle@v4 + - name: Set up Gradle + uses: gradle/actions/setup-gradle@v4 with: cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }} - name: Run Unit Tests @@ -160,13 +181,15 @@ jobs: 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/checkout@v4 - - name: Set up JDK 17 + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Java uses: actions/setup-java@v4 with: java-version: '17' distribution: 'temurin' - - uses: gradle/actions/setup-gradle@v4 + - name: Set up Gradle + uses: gradle/actions/setup-gradle@v4 with: cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }} - name: Run Android Tests diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2c4047a6f..77882c6d6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,10 +1,12 @@ name: Release Pillarbox + on: push: # Pattern matched against refs/tags tags: - '[0-9]+.[0-9]+.[0-9]+' - '[0-9]+.[0-9]+.[0-9]+-[0-9a-zA-Z]+' + jobs: build: runs-on: ubuntu-latest @@ -15,8 +17,9 @@ jobs: VERSION_NAME: ${{ github.ref_name }} steps: - - uses: actions/checkout@v4 - - name: Check if pre release tag + - name: Checkout + uses: actions/checkout@v4 + - name: Check if pre-release tag id: check-tag run: | if [[ "${GITHUB_REF_NAME}" =~ ^[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}-[0-9a-zA-Z]+$ ]]; then @@ -24,25 +27,24 @@ jobs: fi - name: Print release tag run: | - echo "tag = ${GITHUB_REF_NAME}" - echo "version_name = ${VERSION_NAME}" - - name: Set up JDK 17 + echo "Tag: ${GITHUB_REF_NAME}" + echo "Version name: ${VERSION_NAME}" + echo "Pre-release: ${steps.check-tag.outputs.prerelease}" + - name: Set up Java uses: actions/setup-java@v4 with: java-version: '17' distribution: 'temurin' - cache: 'gradle' - server-id: github # Value of the distributionManagement/repository/id field of the pom.xml - settings-path: ${{ github.workspace }} # location for the settings.xml file - # the publishing section of your build.gradle - - uses: gradle/actions/setup-gradle@v4 + - name: Set up Gradle + uses: gradle/actions/setup-gradle@v4 with: cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }} + cache-read-only: true - name: Publish to GitHub Packages run: ./gradlew publish - name: Build with Gradle run: ./gradlew assembleProdRelease - - name: upload artifact to Firebase App Distribution + - name: Upload artifact to Firebase App Distribution uses: wzieba/Firebase-Distribution-Github-Action@v1 with: appId: ${{ secrets.RELEASE_APP_ID }} @@ -56,3 +58,12 @@ jobs: prerelease: steps.check-tag.outputs.prerelease == 'true' skipIfReleaseExists: true generateReleaseNotes: true + - name: Build Dokka documentation + run: ./gradlew :dokkaGenerate + - name: Deploy Dokka documentation + uses: JamesIves/github-pages-deploy-action@v4 + with: + branch: gh-pages + folder: build/dokka/html + single-commit: true + target-folder: api