Skip to content

Commit

Permalink
Merge pull request #14 from NoriginMedia/dmitriy/upgrading-shaka-3.2.10
Browse files Browse the repository at this point in the history
[SDK-216] upgrading shaka to 3.2.10
  • Loading branch information
asgvard authored Jul 26, 2022
2 parents 2a29b2c + 1acf6ae commit 2d4f589
Show file tree
Hide file tree
Showing 460 changed files with 18,769 additions and 7,718 deletions.
12 changes: 11 additions & 1 deletion .csslintrc
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
{
"extends": "stylelint-config-standard",
"customSyntax": "postcss-less",
"rules": {
"font-family-no-missing-generic-family-keyword": null,
"declaration-block-single-line-max-declarations": null,
"declaration-empty-line-before": null,
"max-line-length": [ 80, {
"max-line-length": [80, {
ignorePattern: "/^@import\\s+/",
}],
"function-no-unknown": [true, {
ignoreFunctions: [
"data-uri",
"lighten",
"percentage",
],
}],
"property-no-vendor-prefix": null,
"selector-list-comma-newline-after": "always-multi-line",
"selector-no-vendor-prefix": null,
"selector-pseudo-element-colon-notation": "single",
"unit-allowed-list": ["em", "%", "px", "s", "deg", "vmin", "ms", "vh"]
}
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ assignees: ''
**Can you reproduce the issue with our latest release version?**


**Can you reproduce the issue with the latest code from `master`?**
**Can you reproduce the issue with the latest code from `main`?**


**Are you using the demo app or your own custom app?**
Expand Down
38 changes: 0 additions & 38 deletions .github/pull_request_template.md

This file was deleted.

129 changes: 129 additions & 0 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
name: Build and Test PR

on:
pull_request: # Trigger for pull requests.
types: [opened, synchronize, reopened]
branches:
- main
- v[0-9]*
workflow_dispatch: # Allows for manual triggering.
inputs:
ref:
description: "The ref to build and test."
required: false

# If another instance of this workflow is started for the same PR, cancel the
# old one. If a PR is updated and a new test run is started, the old test run
# will be cancelled automatically to conserve resources.
concurrency:
group: ${{ github.workflow }}-${{ github.event.inputs.ref || github.ref }}
cancel-in-progress: true

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.ref || github.ref }}

- name: Lint
run: python build/check.py

build_and_test:
# Don't waste time doing a full matrix of test runs when there was an
# obvious linter error.
needs: lint
strategy:
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
browser: ["Chrome", "Firefox", "Edge", "Safari", "Safari-14"]
exclude:
- os: ubuntu-latest
browser: Edge
- os: windows-latest
browser: Safari
- os: windows-latest
browser: Safari-14
- os: ubuntu-latest
browser: Safari
- os: ubuntu-latest
browser: Safari-14
include:
# Run Linux browsers with xvfb, so they're in a headless X session.
- os: ubuntu-latest
extra_flags: "--use-xvfb"
# Disable fail-fast so that one matrix-job failing doesn't make the other
# ones end early.
fail-fast: false

name: ${{ matrix.os }} ${{ matrix.browser }}
runs-on: ${{ matrix.os }}

steps:
# Firefox on Ubuntu appears to not have the right things installed in
# the environment used by GitHub actions, so make sure that ffmpeg is
# installed. Otherwise, the browser might not support some codecs that the
# tests assume will be supported.
- name: Install FFmpeg
if: matrix.os == 'ubuntu-latest' && matrix.browser == 'Firefox'
run: sudo apt -y update && sudo apt -y install ffmpeg

- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.ref || github.ref }}

# Safari 14 can be installed, but not to the root, and it can't replace
# the standard version, at least not on GitHub's VMs. If you try to
# install directly to the root with sudo, it will appear to succeed, but
# will have no effect. If you try to script it explicitly with rm -rf
# and cp, this will fail. Safari may be on a read-only filesystem.
- name: Install Safari 14 to home directory
if: matrix.os == 'macos-latest' && matrix.browser == 'Safari-14'
run: |
# Download Safari 14
# See also https://www.macupdate.com/app/mac/15675/apple-safari/old-versions
curl -Lv https://www.macupdate.com/action/download/63550 > safari-14.1.2.pkg
# Install Safari 14 to homedir specifically.
installer -pkg safari-14.1.2.pkg -target CurrentUserHomeDirectory
# Install a launcher that can execute a shell script to launch this
npm install karma-script-launcher --save-dev
- name: Build Player
run: python build/all.py

- name: Test Player
shell: bash
run: |
browser=${{ matrix.browser }}
if [[ "$browser" == "Safari-14" ]]; then
# Replace the browser name with a script that can launch this
# browser from the command line.
browser="$PWD/.github/workflows/safari-homedir-launcher.sh"
fi
python build/test.py \
--browsers "$browser" \
--reporters spec --spec-hide-passed \
${{ matrix.extra_flags }}
build_in_docker:
# Don't waste time doing a full matrix of test runs when there was an
# obvious linter error.
needs: lint
name: Docker
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.ref || github.ref }}

- name: Docker
run: docker-compose -f build/docker/docker-compose.yml up
56 changes: 56 additions & 0 deletions .github/workflows/custom-actions/prep-for-appspot/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Prep Appspot Deployment

description: |
A reusable action that prepares the sources to deploy the Shaka Player Demo
to appspot. Assumes that the source is already checked out.
runs:
using: composite
steps:
- name: Install dependencies
shell: bash
run: npm ci

- name: Build Shaka Player
shell: bash
run: python build/all.py

- name: Extract git version
shell: bash
run: |
(
cd build
python3 -c 'from shakaBuildHelpers import git_version; print(git_version())'
) > demo-version
- name: Tag the Player version
shell: bash
run: |
DEMO_VERSION="$(cat demo-version)-uncompiled"
sed \
-i lib/player.js \
-e "s/\(shaka.Player.version\) = .*/\1 = '$DEMO_VERSION';/"
rm demo-version
- name: Backup demo node modules
shell: bash
run: |
DEMO_NODE_MODULES=$(jq -r .shakaCustom.demoDeps[] package.json)
tar cf demo-modules.tar \
$(echo "$DEMO_NODE_MODULES" | sed -e 's@^@node_modules/@')
- name: Delete unneeded files
shell: bash
run: rm -rf .git .github build externs test node_modules

- name: Restore demo node modules
shell: bash
run: |
tar xf demo-modules.tar
rm demo-modules.tar
- name: Install App Engine code
shell: bash
run: |
mv app-engine/shaka-player-demo/* .
rm README.md
41 changes: 41 additions & 0 deletions .github/workflows/custom-actions/set-commit-status/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Set Commit Status

description: |
A reusable action that sets the commit status. This is used to set PR status
from workflows with non-PR triggers (such as manually-triggered workflows).
inputs:
context:
description: An arbitrary string to identify the status check.
required: true
state:
description: Either "pending", "error", "success", or "failure".
required: true
ref:
description: A git ref for which to set the commit status. For PRs, use the head commit, not the merge commit. Defaults to HEAD.
required: false
default: HEAD
token:
description: A GitHub access token.
required: true

runs:
using: composite
steps:
- name: Report Commit Status
shell: bash
run: |
# This is the URL to view this workflow run on GitHub. It will be
# attached to the commit status, so that when someone clicks "details"
# next to the status on the PR, it will link to this run where they can
# see the logs.
RUN_URL="https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
SHA1=$(git rev-parse "${{ inputs.ref }}")
GITHUB_TOKEN=${{ inputs.token }} \
gh api \
-X POST \
-F "context=${{ inputs.context }}" \
-F "state=${{ inputs.state }}" \
-F "target_url=$RUN_URL" \
"repos/${{ github.repository }}/statuses/$SHA1"
29 changes: 29 additions & 0 deletions .github/workflows/demo-version-index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Deploy Demo Version Index

on:
workflow_dispatch:
# Allows for manual triggering.
push:
branches:
- main
paths:
- .github/workflows/demo-version-index.yaml
- app-engine/demo-version-index/**

jobs:
appspot:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: google-github-actions/auth@v0
with:
credentials_json: '${{ secrets.APPENGINE_DEPLOY_KEY }}'

- uses: google-github-actions/deploy-appengine@v0
with:
project_id: shaka-player-demo
version: index
working_directory: app-engine/demo-version-index/
promote: false

42 changes: 42 additions & 0 deletions .github/workflows/nightly-demo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Deploy Nightly Demo

on:
workflow_dispatch:
# Allows for manual triggering.
schedule:
# Run every night at midnight PST / 8am UTC.
- cron: '0 8 * * *'

jobs:
appspot:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false

- uses: actions/setup-node@v1
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'

# The nightly demo has its own receiver app ID that points to the nightly
# demo itself for the receiver side.
- name: Override Cast Receiver App ID
run: |
sed \
-i demo/index.html \
-e 's/\(data-shaka-player-cast-receiver-id\)="[^"]*"/\1="07AEE832"/'
- uses: ./.github/workflows/custom-actions/prep-for-appspot

- uses: google-github-actions/auth@v0
with:
credentials_json: '${{ secrets.APPENGINE_DEPLOY_KEY }}'

- uses: google-github-actions/deploy-appengine@v0
with:
project_id: shaka-player-demo
version: nightly
promote: false
Loading

0 comments on commit 2d4f589

Please sign in to comment.