From 1e5c4375c702d4c0297cb05e17256dae6cff11d3 Mon Sep 17 00:00:00 2001 From: Walid Kayhal <3347810+waliid@users.noreply.github.com> Date: Tue, 3 Dec 2024 11:01:24 +0100 Subject: [PATCH] Add GitHub workflows (#1075) --- .env | 1 - .github/workflows/nightlies.yml | 39 ++++++++++ .github/workflows/pull-request.yml | 71 ++++++++++++++++++ .github/workflows/releases.yml | 40 +++++++++++ .gitignore | 1 - .../package-info.sh | 16 ++--- Gemfile | 2 - Gemfile.lock | 44 +++--------- Makefile | 72 ++++++++++--------- Scripts/add-apple-certificate.sh | 29 ++++++++ Scripts/check-quality.sh | 5 +- Scripts/checkout-configuration.sh | 58 --------------- Scripts/configure-environment.sh | 12 ++++ Scripts/test-streams.sh | 15 ++-- .../PillarboxCoreBusiness.md | 2 +- fastlane/Fastfile | 8 +-- hooks/pre-commit | 5 -- 17 files changed, 260 insertions(+), 160 deletions(-) delete mode 120000 .env create mode 100644 .github/workflows/nightlies.yml create mode 100644 .github/workflows/pull-request.yml create mode 100644 .github/workflows/releases.yml create mode 100755 Scripts/add-apple-certificate.sh delete mode 100755 Scripts/checkout-configuration.sh create mode 100755 Scripts/configure-environment.sh diff --git a/.env b/.env deleted file mode 120000 index f54419c15..000000000 --- a/.env +++ /dev/null @@ -1 +0,0 @@ -Configuration/.env \ No newline at end of file diff --git a/.github/workflows/nightlies.yml b/.github/workflows/nightlies.yml new file mode 100644 index 000000000..5be3d6d55 --- /dev/null +++ b/.github/workflows/nightlies.yml @@ -0,0 +1,39 @@ +--- +name: Nightlies + +on: # yamllint disable-line rule:truthy + push: + branches: main + +jobs: + deliver-demo-nightlies: + name: πŸŒ™ Nightlies + runs-on: macos-latest + strategy: + matrix: + platform: [ios, tvos] + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Add Apple certificate + run: | + Scripts/add-apple-certificate.sh \ + $RUNNER_TEMP \ + ${{ secrets.KEYCHAIN_PASSWORD }} \ + ${{ secrets.APPLE_DEV_CERTIFICATE }} \ + ${{ secrets.APPLE_DEV_CERTIFICATE_PASSWORD }} + + - name: Configure environment + run: | + Scripts/configure-environment.sh \ + ${{ secrets.APP_STORE_CONNECT_API_KEY }} + + - name: Archive the demo + run: | + make deliver-demo-nightly-${{ matrix.platform }} + env: + TEAM_ID: ${{ secrets.TEAM_ID }} + KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }} + KEY_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ISSUER_ID }} + TESTFLIGHT_GROUPS: ${{ vars.TESTFLIGHT_GROUPS }} diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 000000000..c400c0093 --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,71 @@ +--- +name: Pull Request + +on: # yamllint disable-line rule:truthy + merge_group: + pull_request: + +jobs: + check-quality: + name: πŸ”Ž Check quality + runs-on: macos-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Run the quality check + run: make check-quality + + build-documentation: + name: πŸ“š Build documentation + runs-on: macos-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Build the documentation + run: make doc + + tests: + name: πŸ§ͺ Tests + runs-on: macos-latest + strategy: + matrix: + platform: [ios, tvos] + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Run tests + run: make test-${{ matrix.platform }} + + archive-demos: + name: πŸ“¦ Archives + runs-on: macos-latest + strategy: + matrix: + platform: [ios, tvos] + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Add Apple certificate + run: | + Scripts/add-apple-certificate.sh \ + $RUNNER_TEMP \ + ${{ secrets.KEYCHAIN_PASSWORD }} \ + ${{ secrets.APPLE_DEV_CERTIFICATE }} \ + ${{ secrets.APPLE_DEV_CERTIFICATE_PASSWORD }} + + - name: Configure environment + run: | + Scripts/configure-environment.sh \ + ${{ secrets.APP_STORE_CONNECT_API_KEY }} + + - name: Archive the demo + run: make archive-demo-${{ matrix.platform }} + env: + TEAM_ID: ${{ secrets.TEAM_ID }} + KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }} + KEY_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ISSUER_ID }} + TESTFLIGHT_GROUPS: ${{ vars.TESTFLIGHT_GROUPS }} diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml new file mode 100644 index 000000000..5eaa2b81a --- /dev/null +++ b/.github/workflows/releases.yml @@ -0,0 +1,40 @@ +--- +name: Releases + +on: # yamllint disable-line rule:truthy + push: + branches: main + tags: '*' + +jobs: + deliver-demo-releases: + name: πŸš€ Releases + runs-on: macos-latest + strategy: + matrix: + platform: [ios, tvos] + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Add Apple certificate + run: | + Scripts/add-apple-certificate.sh \ + $RUNNER_TEMP \ + ${{ secrets.KEYCHAIN_PASSWORD }} \ + ${{ secrets.APPLE_DEV_CERTIFICATE }} \ + ${{ secrets.APPLE_DEV_CERTIFICATE_PASSWORD }} + + - name: Configure environment + run: | + Scripts/configure-environment.sh \ + ${{ secrets.APP_STORE_CONNECT_API_KEY }} + + - name: Archive the demo + run: | + make deliver-demo-release-${{ matrix.platform }} + env: + TEAM_ID: ${{ secrets.TEAM_ID }} + KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }} + KEY_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ISSUER_ID }} + TESTFLIGHT_GROUPS: ${{ vars.TESTFLIGHT_GROUPS }} diff --git a/.gitignore b/.gitignore index 7e0373fc9..9ae1a4c5f 100644 --- a/.gitignore +++ b/.gitignore @@ -22,7 +22,6 @@ DerivedData/ /fastlane/README.md /fastlane/report.xml /fastlane/test_output -/Configuration /.bundle /vendor diff --git a/Artifacts/PackageInfo.artifactbundle/package-info.sh b/Artifacts/PackageInfo.artifactbundle/package-info.sh index 7cc63a431..d0a334d4d 100755 --- a/Artifacts/PackageInfo.artifactbundle/package-info.sh +++ b/Artifacts/PackageInfo.artifactbundle/package-info.sh @@ -1,26 +1,26 @@ #!/bin/bash +GENERATED_FILE_PATH="$2/PackageInfo.swift" + if [ "$#" -ne 2 ]; then echo "usage: $(basename "$0") repository_directory output_directory" exit 1 fi -if ! VERSION=$(git --git-dir "$1/.git" describe --tags 2> /dev/null); then - VERSION="0.0.0" +if ! version=$(git --git-dir "$1/.git" describe --tags 2> /dev/null); then + version="0.0.0" fi -if ! SHORT_VERSION=$(git --git-dir "$1/.git" describe --tags --abbrev=0 2> /dev/null); then - SHORT_VERSION="0.0.0" +if ! short_version=$(git --git-dir "$1/.git" describe --tags --abbrev=0 2> /dev/null); then + short_version="0.0.0" fi -GENERATED_FILE_PATH="$2/PackageInfo.swift" - cat > "$GENERATED_FILE_PATH" <<- EOF // This file is generated automatically. Do not modify. import Foundation enum PackageInfo { - static let version = "$VERSION" - static let shortVersion = "$SHORT_VERSION" + static let version = "$version" + static let shortVersion = "$short_version" } EOF diff --git a/Gemfile b/Gemfile index d002b4c31..eb64a7205 100644 --- a/Gemfile +++ b/Gemfile @@ -3,8 +3,6 @@ source 'https://rubygems.org' gem 'fastlane' -gem 'rubocop' -gem 'xcode-install' plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile') eval_gemfile(plugins_path) if File.exist?(plugins_path) diff --git a/Gemfile.lock b/Gemfile.lock index e61f2de9a..a1ebc7d60 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,19 +8,18 @@ GEM addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) artifactory (3.0.17) - ast (2.4.2) atomos (0.1.3) aws-eventstream (1.3.0) - aws-partitions (1.998.0) - aws-sdk-core (3.211.0) + aws-partitions (1.1014.0) + aws-sdk-core (3.214.0) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.992.0) aws-sigv4 (~> 1.9) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.95.0) + aws-sdk-kms (1.96.0) aws-sdk-core (~> 3, >= 3.210.0) aws-sigv4 (~> 1.5) - aws-sdk-s3 (1.169.0) + aws-sdk-s3 (1.174.0) aws-sdk-core (~> 3, >= 3.210.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.5) @@ -162,10 +161,9 @@ GEM domain_name (~> 0.5) httpclient (2.8.3) jmespath (1.6.2) - json (2.7.5) + json (2.8.2) jwt (2.9.3) base64 - language_server-protocol (3.17.0.3) mini_magick (4.13.2) mini_mime (1.1.5) multi_json (1.15.0) @@ -173,18 +171,11 @@ GEM nanaimo (0.4.0) naturally (2.2.1) nkf (0.2.0) - optparse (0.5.0) + optparse (0.6.0) os (1.1.4) - parallel (1.26.3) - parser (3.3.5.0) - ast (~> 2.4.1) - racc plist (3.7.1) public_suffix (6.0.1) - racc (1.8.1) - rainbow (3.1.1) rake (13.2.1) - regexp_parser (2.9.2) representable (3.2.0) declarative (< 0.1.0) trailblazer-option (>= 0.1.1, < 0.2.0) @@ -192,19 +183,6 @@ GEM retriable (3.1.2) rexml (3.3.9) rouge (2.0.7) - rubocop (1.67.0) - json (~> 2.3) - language_server-protocol (>= 3.17.0) - parallel (~> 1.10) - parser (>= 3.3.0.2) - rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 2.4, < 3.0) - rubocop-ast (>= 1.32.2, < 2.0) - ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.33.0) - parser (>= 3.3.1.0) - ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) rubyzip (2.3.2) security (0.1.5) @@ -228,10 +206,7 @@ GEM uber (0.1.0) unicode-display_width (2.6.0) word_wrap (1.0.0) - xcode-install (2.8.1) - claide (>= 0.9.1) - fastlane (>= 2.1.0, < 3.0.0) - xcodeproj (1.26.0) + xcodeproj (1.27.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) @@ -248,6 +223,7 @@ PLATFORMS arm64-darwin-22 arm64-darwin-23 arm64-darwin-24 + ruby x86_64-darwin-21 x86_64-darwin-22 @@ -255,8 +231,6 @@ DEPENDENCIES fastlane fastlane-plugin-badge fastlane-plugin-xcconfig - rubocop - xcode-install BUNDLED WITH - 2.3.7 + 2.5.23 diff --git a/Makefile b/Makefile index 46424af11..3429dd371 100644 --- a/Makefile +++ b/Makefile @@ -1,90 +1,93 @@ #!/usr/bin/xcrun make -f -CONFIGURATION_REPOSITORY_URL=https://github.com/SRGSSR/pillarbox-apple-configuration.git -CONFIGURATION_COMMIT_SHA1=dad52a4242c7997c179073caec03b8d6e718fc03 - .PHONY: all all: help -.PHONY: setup -setup: - @echo "Setting up the project..." - @bundle install > /dev/null - @Scripts/checkout-configuration.sh "${CONFIGURATION_REPOSITORY_URL}" "${CONFIGURATION_COMMIT_SHA1}" Configuration +.PHONY: install-pkgx +install-pkgx: + @echo "Installing pkgx..." + @curl -Ssf https://pkgx.sh | sh &> /dev/null + @echo "... done.\n" + +.PHONY: install-bundler +install-bundler: + @echo "Installing bundler..." + @pkgx bundle config set path '.bundle' + @pkgx bundle install @echo "... done.\n" .PHONY: fastlane -fastlane: setup - @bundle exec fastlane +fastlane: install-pkgx install-bundler + @pkgx bundle exec fastlane .PHONY: archive-demo-ios -archive-demo-ios: setup - @bundle exec fastlane archive_demo_ios +archive-demo-ios: install-pkgx install-bundler + @pkgx bundle exec fastlane archive_demo_ios .PHONY: archive-demo-tvos -archive-demo-tvos: setup - @bundle exec fastlane archive_demo_tvos +archive-demo-tvos: install-pkgx install-bundler + @pkgx bundle exec fastlane archive_demo_tvos .PHONY: deliver-demo-nightly-ios -deliver-demo-nightly-ios: setup +deliver-demo-nightly-ios: install-pkgx install-bundler @echo "Delivering demo nightly build for iOS..." - @bundle exec fastlane deliver_demo_nightly_ios + @pkgx +magick +rsvg-convert bundle exec fastlane deliver_demo_nightly_ios @echo "... done.\n" .PHONY: deliver-demo-nightly-tvos -deliver-demo-nightly-tvos: setup +deliver-demo-nightly-tvos: install-pkgx install-bundler @echo "Delivering demo nightly build for tvOS..." - @bundle exec fastlane deliver_demo_nightly_tvos + @pkgx +magick +rsvg-convert bundle exec fastlane deliver_demo_nightly_tvos @echo "... done.\n" .PHONY: deliver-demo-release-ios -deliver-demo-release-ios: setup +deliver-demo-release-ios: install-pkgx @echo "Delivering demo release build for iOS..." @bundle exec fastlane deliver_demo_release_ios @echo "... done.\n" .PHONY: deliver-demo-release-tvos -deliver-demo-release-tvos: setup +deliver-demo-release-tvos: install-pkgx @echo "Delivering demo release build for tvOS..." @bundle exec fastlane deliver_demo_release_tvos @echo "... done.\n" .PHONY: test-streams-start -test-streams-start: +test-streams-start: install-pkgx @echo "Starting test streams" @Scripts/test-streams.sh -s @echo "... done.\n" .PHONY: test-streams-stop -test-streams-stop: +test-streams-stop: install-pkgx @echo "Stopping test streams" @Scripts/test-streams.sh -k @echo "... done.\n" .PHONY: test-ios -test-ios: setup +test-ios: install-pkgx install-bundler @echo "Running unit tests..." @Scripts/test-streams.sh -s - @bundle exec fastlane test_ios + @pkgx bundle exec fastlane test_ios @Scripts/test-streams.sh -k @echo "... done.\n" .PHONY: test-tvos -test-tvos: setup +test-tvos: install-pkgx install-bundler @echo "Running unit tests..." @Scripts/test-streams.sh -s - @bundle exec fastlane test_tvos + @pkgx bundle exec fastlane test_tvos @Scripts/test-streams.sh -k @echo "... done.\n" .PHONY: check-quality -check-quality: setup +check-quality: install-pkgx @echo "Checking quality..." @Scripts/check-quality.sh @echo "... done.\n" .PHONY: fix-quality -fix-quality: setup +fix-quality: install-pkgx @echo "Fixing quality..." @Scripts/fix-quality.sh @echo "... done.\n" @@ -115,9 +118,9 @@ clean-imports: @echo "Cleaning imports..." @mkdir -p .build @xcodebuild -scheme Pillarbox -destination generic/platform=ios > ./.build/xcodebuild.log - @swiftlint analyze --fix --compiler-log-path ./.build/xcodebuild.log + @pkgx swiftlint analyze --fix --compiler-log-path ./.build/xcodebuild.log @xcodebuild -scheme Pillarbox-demo -project ./Demo/Pillarbox-demo.xcodeproj -destination generic/platform=iOS > ./.build/xcodebuild.log - @swiftlint analyze --fix --compiler-log-path ./.build/xcodebuild.log + @pkgx swiftlint analyze --fix --compiler-log-path ./.build/xcodebuild.log @echo "... done.\n" .PHONY: find-dead-code @@ -125,15 +128,15 @@ find-dead-code: @echo "Start checking dead code..." @mkdir -p .build @xcodebuild -scheme Pillarbox -destination generic/platform=iOS -derivedDataPath ./.build/derived-data clean build &> /dev/null - @periphery scan --retain-public --skip-build --index-store-path ./.build/derived-data/Index.noindex/DataStore/ + @pkgx periphery scan --retain-public --skip-build --index-store-path ./.build/derived-data/Index.noindex/DataStore/ @xcodebuild -scheme Pillarbox-demo -project ./Demo/Pillarbox-demo.xcodeproj -destination generic/platform=iOS -derivedDataPath ./.build/derived-data clean build &> /dev/null - @periphery scan --project ./Demo/Pillarbox-demo.xcodeproj --schemes Pillarbox-demo --targets Pillarbox-demo --skip-build --index-store-path ./.build/derived-data/Index.noindex/DataStore/ + @pkgx periphery scan --project ./Demo/Pillarbox-demo.xcodeproj --schemes Pillarbox-demo --targets Pillarbox-demo --skip-build --index-store-path ./.build/derived-data/Index.noindex/DataStore/ @echo "... done.\n" .PHONY: doc -doc: setup +doc: install-pkgx @echo "Generating documentation sets..." - @bundle exec fastlane doc + @pkgx fastlane doc @echo "... done.\n" .PHONY: help @@ -141,7 +144,6 @@ help: @echo "The following targets are available:" @echo "" @echo " all Default target" - @echo " setup Setup project" @echo "" @echo " fastlane Run fastlane" @echo "" diff --git a/Scripts/add-apple-certificate.sh b/Scripts/add-apple-certificate.sh new file mode 100755 index 000000000..62770c1c2 --- /dev/null +++ b/Scripts/add-apple-certificate.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +ROOT_DIR="$1" +KEYCHAIN_PASSWORD="$2" +APPLE_CERTIFICATE_BASE64="$3" +APPLE_CERTIFICATE_PASSWORD="$4" + +if [[ -z $ROOT_DIR || -z $KEYCHAIN_PASSWORD || -z $APPLE_CERTIFICATE_BASE64 || -z $APPLE_CERTIFICATE_PASSWORD ]] +then + echo "[!] Usage: $0 " + exit 1 +fi + +KEYCHAIN_PATH="$ROOT_DIR/app-signing.keychain-db" +APPLE_CERTIFICATE="$ROOT_DIR/certificate.p12" + +echo -n "$APPLE_CERTIFICATE_BASE64" | base64 --decode -o "$APPLE_CERTIFICATE" + +# Create a temporary keychain (https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners) +security create-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH" +security set-keychain-settings -lut 21600 "$KEYCHAIN_PATH" +security unlock-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH" + +# Import certificate +security import "$APPLE_CERTIFICATE" -k "$KEYCHAIN_PATH" -P "$APPLE_CERTIFICATE_PASSWORD" -A -t cert -f pkcs12 +# Authorize access to certificate private key +security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH" +# Set the default keychain +security list-keychain -d user -s "$KEYCHAIN_PATH" diff --git a/Scripts/check-quality.sh b/Scripts/check-quality.sh index 922579920..e31a467b5 100755 --- a/Scripts/check-quality.sh +++ b/Scripts/check-quality.sh @@ -2,6 +2,9 @@ set -e +eval "$(pkgx --shellcode)" +env +swiftlint +rubocop +shellcheck +markdownlint +yamllint + echo "... checking Swift code..." if [ $# -eq 0 ]; then swiftlint --quiet --strict @@ -9,7 +12,7 @@ elif [[ "$1" == "only-changes" ]]; then git diff --staged --name-only | grep ".swift$" | xargs swiftlint lint --quiet --strict fi echo "... checking Ruby scripts..." -bundle exec rubocop --format quiet +rubocop --format quiet echo "... checking Shell scripts..." shellcheck Scripts/*.sh hooks/* Artifacts/**/*.sh echo "... checking Markdown documentation..." diff --git a/Scripts/checkout-configuration.sh b/Scripts/checkout-configuration.sh deleted file mode 100755 index fdc5a8581..000000000 --- a/Scripts/checkout-configuration.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/bash - -# This script attempts to checkout a configuration repository URL and to switch to a specific commit. - -CONFIGURATION_REPOSITORY_URL=$1 -CONFIGURATION_COMMIT_SHA1=$2 -CONFIGURATION_FOLDER=$3 - -if [[ -z "$CONFIGURATION_REPOSITORY_URL" ]]; then - echo "A configuration repository URL must be provided." - exit 1 -fi - -if [[ -z "$CONFIGURATION_COMMIT_SHA1" ]]; then - echo "A configuration commit SHA1 must be provided." - exit 1 -fi - -if [[ -z "$CONFIGURATION_FOLDER" ]]; then - echo "A configuration destination folder must be provided." - exit 1 -fi - -if [[ ! -d "$CONFIGURATION_FOLDER" ]]; then - if git clone "$CONFIGURATION_REPOSITORY_URL" "$CONFIGURATION_FOLDER" &> /dev/null; then - echo "Private configuration details were successfully cloned under the '$CONFIGURATION_FOLDER' folder." - else - echo "Your GitHub account cannot access private project configuration details. Skipped." - exit 0 - fi -else - echo "A '$CONFIGURATION_FOLDER' folder is already available." -fi - -pushd "$CONFIGURATION_FOLDER" > /dev/null || exit - -if ! git status &> /dev/null; then - echo "The '$CONFIGURATION_FOLDER' folder is not a valid git repository." - exit 1 -fi - -if [[ $(git status --porcelain 2> /dev/null) ]]; then - echo "The repository '$CONFIGURATION_FOLDER' contains changes. Please commit or discard these changes and retry." - exit 1 -fi - -git fetch &> /dev/null - -if git checkout -q "$CONFIGURATION_COMMIT_SHA1" &> /dev/null; then - echo "The '$CONFIGURATION_FOLDER' repository has been switched to commit $CONFIGURATION_COMMIT_SHA1." -else - echo "The repository '$CONFIGURATION_FOLDER' could not be switched to commit $CONFIGURATION_COMMIT_SHA1. Does this commit exist?" - exit 1 -fi - -popd > /dev/null || exit - -ln -fs "$CONFIGURATION_FOLDER/.env" . diff --git a/Scripts/configure-environment.sh b/Scripts/configure-environment.sh new file mode 100755 index 000000000..9d92182ec --- /dev/null +++ b/Scripts/configure-environment.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +APPLE_API_KEY_BASE64="$1" + +if [[ -z $APPLE_API_KEY_BASE64 ]] +then + echo "[!] Usage: $0 " + exit 1 +fi + +mkdir -p Configuration +echo "$APPLE_API_KEY_BASE64" | base64 --decode > Configuration/AppStoreConnect_API_Key.p8 diff --git a/Scripts/test-streams.sh b/Scripts/test-streams.sh index a1d13df78..d3c292836 100755 --- a/Scripts/test-streams.sh +++ b/Scripts/test-streams.sh @@ -3,6 +3,9 @@ SCRIPT_NAME=$(basename "$0") SCRIPT_DIR=$(dirname "$0") +eval "$(pkgx --shellcode)" +env +python +ffmpeg +packager + GENERATED_DIR="/tmp/pillarbox" METADATA_DIR="$SCRIPT_DIR/../metadata" @@ -14,8 +17,8 @@ function serve_test_streams { kill_test_streams "$dest_dir" - if ! command -v python3 &> /dev/null; then - echo "python3 could not be found" + if ! command -v python &> /dev/null; then + echo "python could not be found" exit 1 fi @@ -89,7 +92,7 @@ function generate_packaged_streams { mkdir -p "$dest_dir" local on_demand_with_options_dir="$dest_dir/on_demand_with_options" - shaka-packager \ + packager \ "in=$src_dir/source_640x360.mp4,stream=video,segment_template=$on_demand_with_options_dir/640x360/\$Number\$.ts" \ "in=$src_dir/source_audio_eng.mp4,stream=audio,segment_template=$on_demand_with_options_dir/audio_eng/\$Number\$.ts,lang=en,hls_name=English" \ "in=$src_dir/source_audio_fre.mp4,stream=audio,segment_template=$on_demand_with_options_dir/audio_fre/\$Number\$.ts,lang=fr,hls_name=FranΓ§ais" \ @@ -100,19 +103,19 @@ function generate_packaged_streams { --hls_master_playlist_output "$on_demand_with_options_dir/master.m3u8" > /dev/null 2>&1 local on_demand_without_options_dir="$dest_dir/on_demand_without_options" - shaka-packager \ + packager \ "in=$src_dir/source_640x360.mp4,stream=video,segment_template=$on_demand_without_options_dir/640x360/\$Number\$.ts" \ --hls_master_playlist_output "$on_demand_without_options_dir/master.m3u8" > /dev/null 2>&1 local on_demand_with_single_audible_option_dir="$dest_dir/on_demand_with_single_audible_option" - shaka-packager \ + packager \ "in=$src_dir/source_640x360.mp4,stream=video,segment_template=$on_demand_with_single_audible_option_dir/640x360/\$Number\$.ts" \ "in=$src_dir/source_audio_eng.mp4,stream=audio,segment_template=$on_demand_with_single_audible_option_dir/audio_eng/\$Number\$.ts,lang=en,hls_name=English" \ --hls_master_playlist_output "$on_demand_with_single_audible_option_dir/master.m3u8" > /dev/null 2>&1 } function serve_directory { - python3 -m http.server 8123 --directory "$1" > /dev/null 2>&1 & + python -m http.server 8123 --directory "$1" > /dev/null 2>&1 & } function kill_test_streams { diff --git a/Sources/CoreBusiness/CoreBusiness.docc/PillarboxCoreBusiness.md b/Sources/CoreBusiness/CoreBusiness.docc/PillarboxCoreBusiness.md index dbb0d7e9a..94b384c1a 100644 --- a/Sources/CoreBusiness/CoreBusiness.docc/PillarboxCoreBusiness.md +++ b/Sources/CoreBusiness/CoreBusiness.docc/PillarboxCoreBusiness.md @@ -22,7 +22,7 @@ To play an SRG SSR content simply create a `PlayerItem` with ``PillarboxPlayer/P You can optionally change the server or add additional custom player item trackers. Standard SRG SSR trackers cannot be disabled. -> Tip: Tracker adapters receive standard a ``MediaMetadata`` instance as parameter. If data your tracker needs is not available please file a corresponding [issue](https://github.com/SRGSSR/pillarbox-apple/issues/new?assignees=&labels=enhancement%2Ctriage&projects=&template=feature_request.yaml) so that we can parse it. +> Tip: Tracker adapters receive standard a ``MediaMetadata`` instance as parameter. If data your tracker needs is not available please file a corresponding [issue](https://github.com/SRGSSR/pillarbox-apple/issues/new?assignees=&labels=enhancement%2Ctriage&projects=&template=feature_request.yml) so that we can parse it. ### Avoid background playback diff --git a/fastlane/Fastfile b/fastlane/Fastfile index da9a2d4a9..ce0f1ad20 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -19,7 +19,7 @@ TESTFLIGHT_PLATFORMS = { }.freeze DEVICES = { - ios: 'iPhone 15', + ios: 'iPhone 16', tvos: 'Apple TV' }.freeze @@ -197,14 +197,8 @@ def run_package_tests(platform_id, scheme_name) result_bundle: true, number_of_retries: 3, clean: true, - fail_build: false, xcargs: '-testLanguage en -testRegion en_US' ) - trainer( - path: 'fastlane/test_output', - output_remove_retry_attempts: true, - fail_build: false - ) end def run_all_tests(platform_id) diff --git a/hooks/pre-commit b/hooks/pre-commit index 0c60fb90c..b9a31b506 100755 --- a/hooks/pre-commit +++ b/hooks/pre-commit @@ -1,11 +1,6 @@ #!/bin/sh -#================================================================ # Quality check -#================================================================ - -PATH="$(which swiftlint):$(which ruby):$PATH" - if Scripts/check-quality.sh only-changes; then echo "βœ… Quality checked" else