Skip to content

Commit

Permalink
Release build 5.24.0 [ci release]
Browse files Browse the repository at this point in the history
  • Loading branch information
shakyShane authored and github-actions[bot] committed Jun 28, 2024
1 parent cefe06b commit 70aa5f1
Show file tree
Hide file tree
Showing 119 changed files with 20,983 additions and 951 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: PR Build and Release

on:
pull_request:
types: [opened, synchronize, closed, ready_for_review]

jobs:
build:
if: github.event.pull_request.draft == false && github.event.action != 'closed'
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'

- name: Install dependencies
run: npm install

- name: Run build
run: npm run build

- name: Create and push release branch
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git checkout -b pr-releases/pr-${PR_NUMBER}
git add -f build
git commit -m "Add build folder for PR #${PR_NUMBER}"
git push -u origin pr-releases/pr-${PR_NUMBER} --force
clean_up:
if: github.event.action == 'closed'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Delete release branch
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git push origin --delete pr-releases/pr-${PR_NUMBER}
1 change: 1 addition & 0 deletions .swift-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5.5
34 changes: 18 additions & 16 deletions Sources/ContentScopeScripts/dist/pages/duckplayer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -408,22 +408,6 @@
this.overlayInteracted = params.overlayInteracted;
}
};
async function callWithRetry(fn, params = {}) {
const { maxAttempts = 10, intervalMs = 300 } = params;
let attempt = 1;
while (attempt <= maxAttempts) {
try {
return { value: await fn(), attempt };
} catch (error) {
if (attempt === maxAttempts) {
return { error: `Max attempts reached: ${error}` };
}
await new Promise((resolve) => setTimeout(resolve, intervalMs));
attempt++;
}
}
return { error: "Unreachable: value not retrieved" };
}

// ../../src/dom-utils.js
var Template = class _Template {
Expand Down Expand Up @@ -1564,6 +1548,24 @@
return new Messaging(messageContext, fallback);
}

// shared/call-with-retry.js
async function callWithRetry(fn, params = {}) {
const { maxAttempts = 10, intervalMs = 300 } = params;
let attempt = 1;
while (attempt <= maxAttempts) {
try {
return { value: await fn(), attempt };
} catch (error) {
if (attempt === maxAttempts) {
return { error: `Max attempts reached: ${error}` };
}
await new Promise((resolve) => setTimeout(resolve, intervalMs));
attempt++;
}
}
return { error: "Unreachable: value not retrieved" };
}

// pages/duckplayer/src/js/index.js
var VideoPlayer = {
/**
Expand Down
34 changes: 18 additions & 16 deletions Sources/ContentScopeScripts/dist/pages/duckplayer/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,22 +94,6 @@
this.overlayInteracted = params.overlayInteracted;
}
};
async function callWithRetry(fn, params = {}) {
const { maxAttempts = 10, intervalMs = 300 } = params;
let attempt = 1;
while (attempt <= maxAttempts) {
try {
return { value: await fn(), attempt };
} catch (error) {
if (attempt === maxAttempts) {
return { error: `Max attempts reached: ${error}` };
}
await new Promise((resolve) => setTimeout(resolve, intervalMs));
attempt++;
}
}
return { error: "Unreachable: value not retrieved" };
}

// ../../src/dom-utils.js
var Template = class _Template {
Expand Down Expand Up @@ -1250,6 +1234,24 @@
return new Messaging(messageContext, fallback);
}

// shared/call-with-retry.js
async function callWithRetry(fn, params = {}) {
const { maxAttempts = 10, intervalMs = 300 } = params;
let attempt = 1;
while (attempt <= maxAttempts) {
try {
return { value: await fn(), attempt };
} catch (error) {
if (attempt === maxAttempts) {
return { error: `Max attempts reached: ${error}` };
}
await new Promise((resolve) => setTimeout(resolve, intervalMs));
attempt++;
}
}
return { error: "Unreachable: value not retrieved" };
}

// pages/duckplayer/src/js/index.js
var VideoPlayer = {
/**
Expand Down
37 changes: 0 additions & 37 deletions Sources/ContentScopeScripts/dist/pages/duckplayer/js/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,40 +148,3 @@ export class DuckPlayerPageSettings {
this.pip = params.pip
}
}

/**
* This will return either { value: awaited value },
* { error: error message }
*
* It will execute the given function in uniform intervals
* until either:
* 1: the given function stops throwing errors
* 2: the maxAttempts limit is reached
*
* This is useful for situations where you don't want to continue
* until a result is found - normally to work around race-conditions
*
* @template {(...args: any[]) => any} FN
* @param {FN} fn
* @param {{maxAttempts?: number, intervalMs?: number}} params
* @returns {Promise<{ value: Awaited<ReturnType<FN>>, attempt: number } | { error: string }>}
*/
export async function callWithRetry (fn, params = {}) {
const { maxAttempts = 10, intervalMs = 300 } = params
let attempt = 1

while (attempt <= maxAttempts) {
try {
return { value: await fn(), attempt }
} catch (error) {
if (attempt === maxAttempts) {
return { error: `Max attempts reached: ${error}` }
}

await new Promise((resolve) => setTimeout(resolve, intervalMs))
attempt++
}
}

return { error: 'Unreachable: value not retrieved' }
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 70aa5f1

Please sign in to comment.