Compare commits

..
9 Commits
Author SHA1 Message Date
Brahim Hadriche 3697eafc43 Release v0.23.0 (#358) 2024-04-04 12:22:14 -04:00
Brahim Hadriche c741466a85 shorten link in web app 2024-04-04 11:24:20 -04:00
Brahim Hadriche 1cbb52fad4 Load playlet lib as squashfs (#357)
* Load playlet lib as squashfs

* typo
2024-04-04 11:10:23 -04:00
Brahim Hadriche b534ea68db Feature/squashfs (#356)
* shorten link

* Add zip to squash

* squashfs signing

* Format

* add secrets

* release fix

* revert testing

* check for needed commands

* changelog
2024-04-03 17:31:35 -04:00
Brahim Hadriche dc7cded3f5 shorten link 2024-04-02 13:32:03 -04:00
Brahim Hadriche 76a57af5a0 use short git commit hash 2024-04-02 12:13:15 -04:00
Brahim Hadriche e73fc9ab72 http logging tweak 2024-04-02 09:31:35 -04:00
Brahim Hadriche cac9090f4d Fix for disabled popular endpoint 2024-04-01 09:42:30 -04:00
Brahim Hadriche b8ed900769 Adjust web app video rows 2024-04-01 08:29:21 -04:00
26 changed files with 145 additions and 96 deletions

No files matched your search

+7 -2
View File
@@ -30,7 +30,12 @@ jobs:
run: npm run test:build
- name: Build Playlet
run: npm run build:release:ci
run: npm run build:release
env:
ROKU_DEV_TARGET: ${{ secrets.ROKU_DEV_TARGET }}
ROKU_DEV_TARGET_PORT: ${{ secrets.ROKU_DEV_TARGET_PORT }}
ROKU_DEVPASSWORD: ${{ secrets.ROKU_DEVPASSWORD }}
ROKU_SIGN_PASSWORD: ${{ secrets.ROKU_SIGN_PASSWORD }}
- name: Use Java 21
uses: actions/setup-java@v4
@@ -70,6 +75,6 @@ jobs:
run: sleep 10
- name: Create Canary release
run: gh release create canary ./release/playlet.zip ./release/playlet-lib.zip --notes-file docs/canary-changelog.md --prerelease --title Canary
run: gh release create canary ./release/playlet.zip ./release/playlet.squashfs.pkg ./release/playlet-lib.zip ./release/playlet-lib.squashfs.pkg --notes-file docs/canary-changelog.md --prerelease --title Canary
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
+6
View File
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.23.0] - 2024-04-04
### Added
- Loading Playlet lib as squashfs, with fallback to the zip file. This significantly decreases load times.
## [0.22.3] - 2024-03-31
### Changed
+1 -8
View File
@@ -40,11 +40,4 @@ These are mostly the steps when releasing a new version:
## Playlet
For releasing to the store (when needed), this is done following a Playlet lib release:
- Switch to main branch and pull changes, **including tags** - **match commit corresponding to the release.**
- `npm run build:release:ci`
- This makes sure to have a valid app in the staging folder
- `npm run sign-released-package`
- This should create the signed package under `release/playlet.pkg`
- Upload to dashboard, and schedule a release (takes a couple of days)
For releasing to the store (when needed), signed packages are attached to Github releases, ready to publish
+1 -1
View File
@@ -2,7 +2,7 @@ openapi: 3.0.0
info:
title: Playlet Web API
version: 0.22.3
version: 0.23.0
description:
Playlet Web API is a RESTful API for controlling the Playlet app on
Roku devices. The API is intended to be used by the Playlet web app, but can
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "playlet",
"version": "0.22.3",
"version": "0.23.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "playlet",
"version": "0.22.3",
"version": "0.23.0",
"hasInstallScript": true,
"devDependencies": {
"@rokucommunity/bslint": "^0.8.20",
+2 -4
View File
@@ -1,6 +1,6 @@
{
"name": "playlet",
"version": "0.22.3",
"version": "0.23.0",
"description": "Unofficial YouTube client for Roku",
"devDependencies": {
"@rokucommunity/bslint": "^0.8.20",
@@ -40,8 +40,7 @@
"prebuild": "rm -rf dist",
"build:dev": "npm run build:web && npm run build:lib:dev && npm run build:app:dev",
"build:prod": "npm run build:web && npm run build:lib:prod && npm run build:app:prod",
"build:release": "npm run build:release:ci && npm run sign-package",
"build:release:ci": "npm run format:fix && npm run lint:fix && npm run version-sync && npm run manifest-git-hash && npm run build:prod",
"build:release": "npm run format:fix && npm run lint:fix && npm run version-sync && npm run manifest-git-hash && npm run build:prod",
"build:app:dev": "cd playlet-app && npm run build:dev",
"build:app:prod": "cd playlet-app && npm run build:prod",
"build:lib:dev": "cd playlet-lib && npm run build:dev",
@@ -59,7 +58,6 @@
"test:build:lib": "cd playlet-lib && npm run test:build",
"version-sync": "node tools/version-sync.js",
"manifest-git-hash": "node tools/update-manifest-git-hash.js",
"sign-package": "node tools/sign-package.js",
"sign-released-package": "node tools/sign-released-package.js",
"screenshot": "node tools/screenshot.js",
"profile-sync": "node tools/profile-sync.js",
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "playlet-app",
"version": "0.22.3",
"version": "0.23.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "playlet-app",
"version": "0.22.3"
"version": "0.23.0"
}
}
}
+5 -3
View File
@@ -1,14 +1,16 @@
{
"name": "playlet-app",
"version": "0.22.3",
"version": "0.23.0",
"description": "Unofficial YouTube client for Roku",
"scripts": {
"prebuild": "rm -rf build/playlet-app",
"prebuild": "rm -rf ../build/playlet-app",
"prebuild:dev": "npm run prebuild",
"prebuild:prod": "npm run prebuild",
"build:dev": "bsc --create-package --debug --sourceMap=true --lintConfig ../config/bslint.jsonc",
"build:prod": "bsc --create-package --sourceMap=false --lintConfig ../config/bslint.jsonc",
"postbuild:prod": "mkdir -p ../release && cp ../dist/playlet-app.zip ../release/playlet.zip",
"postbuild:prod": "mkdir -p ../release && cp ../dist/playlet-app.zip ../release/playlet.zip && npm run squash-fs && npm run sign-package",
"squash-fs": "node ../tools/squash-fs.js --in-file ../release/playlet.zip --out-file ../release/playlet.squashfs.zip",
"sign-package": "node ../tools/sign-package.js --out-file playlet.squashfs.zip --out-dir ../release --staging-dir ../build/playlet-app",
"lint": "bslint --project bsconfig.lint.json --lintConfig ../config/bslint.jsonc",
"lint:fix": "npm run lint -- --fix",
"format:base": "bsfmt \"src/**/*.brs\" \"src/**/*.bs\" \"!**/bslib.brs\" \"!**/roku_modules/**/*\" \"!**/*.transpiled/**\" \"!**/*.transpiled.*\" --bsfmt-path ../config/bsfmt.jsonc",
@@ -22,8 +22,8 @@ end function
function GetPlayletLibUrls() as object
#if DEBUG
debug = { type: "debug", link: Manifest.ReadValue("playlet_lib_debug_url") }
embedded = { type: "embedded", link: Manifest.ReadValue("playlet_lib_embedded_url") }
debug = { type: "debug-zip", link: Manifest.ReadValue("playlet_lib_zip_debug_url") }
embedded = { type: "embedded-zip", link: Manifest.ReadValue("playlet_lib_zip_embedded_url") }
#if DEBUG_FALLBACK_TO_EMBEDDED
return [debug, embedded]
#else
@@ -36,9 +36,10 @@ function GetPlayletLibUrls() as object
return savedUrls
end if
github = { type: "github", link: Manifest.ReadValue("playlet_lib_remote_url") }
embedded = { type: "embedded", link: Manifest.ReadValue("playlet_lib_embedded_url") }
return [github, embedded]
githubSquashFs = { type: "github-squashfs", link: Manifest.ReadValue("playlet_lib_squashfs_remote_url") }
githubZip = { type: "github-zip", link: Manifest.ReadValue("playlet_lib_zip_remote_url") }
embedded = { type: "embedded-zip", link: Manifest.ReadValue("playlet_lib_zip_embedded_url") }
return [githubSquashFs, githubZip, embedded]
#end if
end function
+6 -5
View File
@@ -2,8 +2,8 @@ title=Playlet
# Do not update version manually, it is auto updated from package.json
major_version=0
minor_version=22
build_version=00003
minor_version=23
build_version=00000
ui_resolutions=hd
@@ -27,9 +27,10 @@ confirm_partner_button=1
supports_input_launch=1
playlet_lib_remote_url=https://github.com/iBicha/playlet/releases/latest/download/playlet-lib.zip
playlet_lib_embedded_url=pkg:/lib/playlet-lib.zip
playlet_lib_debug_url=http://DEBUG_HOST_IP_ADDRESS:8086/playlet-lib.zip
playlet_lib_squashfs_remote_url=https://github.com/iBicha/playlet/releases/latest/download/playlet-lib.squashfs.pkg
playlet_lib_zip_remote_url=https://github.com/iBicha/playlet/releases/latest/download/playlet-lib.zip
playlet_lib_zip_embedded_url=pkg:/lib/playlet-lib.zip
playlet_lib_zip_debug_url=http://DEBUG_HOST_IP_ADDRESS:8086/playlet-lib.zip
git_commit_sha=unknown
+3 -2
View File
@@ -8,8 +8,9 @@ namespace Tests
@it("Reads values from manifest")
@params("title", "Playlet")
@params("supports_input_launch", "1")
@params("playlet_lib_remote_url", "https://github.com/iBicha/playlet/releases/latest/download/playlet-lib.zip")
@params("playlet_lib_embedded_url", "pkg:/lib/playlet-lib.zip")
@params("playlet_lib_squashfs_remote_url", "https://github.com/iBicha/playlet/releases/latest/download/playlet-lib.squashfs.pkg")
@params("playlet_lib_zip_remote_url", "https://github.com/iBicha/playlet/releases/latest/download/playlet-lib.zip")
@params("playlet_lib_zip_embedded_url", "pkg:/lib/playlet-lib.zip")
function _(key as string, expectedValue as string)
m.assertEqual(Manifest.ReadValue(key), expectedValue)
end function
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "playlet-lib",
"version": "0.22.3",
"version": "0.23.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "playlet-lib",
"version": "0.22.3"
"version": "0.23.0"
}
}
}
+5 -3
View File
@@ -1,16 +1,18 @@
{
"name": "playlet-lib",
"version": "0.22.3",
"version": "0.23.0",
"description": "Unofficial YouTube client for Roku",
"scripts": {
"prebuild": "rm -rf build/playlet-lib",
"prebuild": "rm -rf ../build/playlet-lib",
"prebuild:dev": "npm run prebuild",
"prebuild:prod": "npm run prebuild",
"build:dev": "bsc --create-package --debug --sourceMap=true --lintConfig ../config/bslint.jsonc",
"build:prod": "bsc --create-package --sourceMap=false --lintConfig ../config/bslint.jsonc",
"postbuild": "mkdir -p ../release && mkdir -p ../playlet-app/src/lib && cp ../dist/playlet-lib.zip ../playlet-app/src/lib/playlet-lib.zip",
"postbuild:dev": "npm run postbuild",
"postbuild:prod": "npm run postbuild && cp ../dist/playlet-lib.zip ../release/playlet-lib.zip",
"postbuild:prod": "npm run postbuild && cp ../dist/playlet-lib.zip ../release/playlet-lib.zip && npm run squash-fs && npm run sign-package",
"squash-fs": "node ../tools/squash-fs.js --in-file ../release/playlet-lib.zip --out-file ../release/playlet-lib.squashfs.zip",
"sign-package": "node ../tools/sign-package.js --out-file playlet-lib.squashfs.zip --out-dir ../release --staging-dir ../build/playlet-lib",
"lint": "bslint --project bsconfig.lint.json --lintConfig ../config/bslint.jsonc",
"lint:fix": "npm run lint -- --fix",
"format:base": "bsfmt \"src/**/*.brs\" \"src/**/*.bs\" \"!**/bslib.brs\" \"!**/roku_modules/**/*\" \"!**/*.transpiled/**\" \"!**/*.transpiled.*\" --bsfmt-path ../config/bsfmt.jsonc",
@@ -71,8 +71,8 @@ function VideoRowListRowContentTask(input as object) as object
continue while
end if
' Invidious returns 500 and "{"error":"Closed stream"}" when the Popular feed is disabled
if feedSource.endpoint = "popular" and response.error.instr("Closed stream") > -1
' Invidious returns 400 and "{"error":"Administrator has disabled this endpoint."}" when the Popular feed is disabled
if feedSource.endpoint = "popular" and response.error.instr("Administrator has disabled this endpoint.") > -1
LogWarn("Popular feedSource not available:", response.error)
if feedSources.Count() = 1
parent = feedContentNode.getParent()
@@ -45,7 +45,7 @@ namespace Http
end function
function Recycle()
LogInfo("recycle")
LogDebug("recycle")
m.Restart()
m.SetState(Http.HttpConnectionState.RECV_REQUEST) ' ready for another
end function
+2 -2
View File
@@ -2,8 +2,8 @@ title=PlayletLib
# Do not update version manually, it is auto updated from package.json
major_version=0
minor_version=22
build_version=00003
minor_version=23
build_version=00000
ui_resolutions=hd
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "playlet-web",
"version": "0.22.3",
"version": "0.23.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "playlet-web",
"version": "0.22.3",
"version": "0.23.0",
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^3.0.2",
"@tailwindcss/typography": "^0.5.12",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "playlet-web",
"version": "0.22.3",
"version": "0.23.0",
"type": "module",
"scripts": {
"dev": "vite",
+6
View File
@@ -142,6 +142,9 @@ export class PlayletApi {
static async setPlayletLibVersion(tag) {
if (tag !== "") {
const urls = [{
link: `https://github.com/iBicha/playlet/releases/download/${tag}/playlet-lib.squashfs.pkg`,
type: 'custom'
}, {
link: `https://github.com/iBicha/playlet/releases/download/${tag}/playlet-lib.zip`,
type: 'custom'
}]
@@ -149,6 +152,9 @@ export class PlayletApi {
// To avoid the "not found" error, we fallback to the default "latest" release.
if (tag === "canary") {
urls.push({
link: `https://github.com/iBicha/playlet/releases/latest/download/playlet-lib.squashfs.pkg`,
type: 'custom'
}, {
link: `https://github.com/iBicha/playlet/releases/latest/download/playlet-lib.zip`,
type: 'custom'
})
@@ -66,7 +66,13 @@
case "lib_version_latest":
return `<a class="link" href="https://github.com/iBicha/playlet/releases/tag/v${value}" target="_blank" rel="noopener noreferrer">${value}</a>`;
case "lib_url":
return `<a class="link" href="${value}" target="_blank" rel="noopener noreferrer">${value}</a>`;
const filename =
value &&
value.includes("/") &&
(value.endsWith(".zip") || value.endsWith(".pkg"))
? value.substring(value.lastIndexOf("/") + 1)
: value;
return `<a class="link" href="${value}" target="_blank" rel="noopener noreferrer">${filename}</a>`;
case "app_git_commit_hash":
case "lib_git_commit_hash":
if (value === "unknown") {
@@ -38,7 +38,9 @@
const release = releases[i].name;
if (
libUrl ===
`https://github.com/iBicha/playlet/releases/download/${release}/playlet-lib.zip`
`https://github.com/iBicha/playlet/releases/download/${release}/playlet-lib.zip` ||
libUrl ===
`https://github.com/iBicha/playlet/releases/download/${release}/playlet-lib.squashfs.pkg`
) {
selectedRelease = release;
break;
@@ -55,8 +57,11 @@
return {
name: release.tag_name,
enabled:
release.assets.filter((asset) => asset.name === "playlet-lib.zip")
.length > 0,
release.assets.filter(
(asset) =>
asset.name === "playlet-lib.zip" ||
asset.name === "playlet-lib.squashfs.pkg"
).length > 0,
};
});
}
@@ -209,7 +209,7 @@
videos = [...(videos || []), ...newVideos];
totalFetchedItems += result.items.length;
if (totalFetchedItems >= 3) {
if (totalFetchedItems >= 6) {
break;
}
}
+19 -3
View File
@@ -3,16 +3,32 @@
const getEnvVars = require('./get-env-vars');
const rokuDeploy = require('roku-deploy');
const { ArgumentParser } = require('argparse');
const config = getEnvVars(['ROKU_DEV_TARGET', 'ROKU_DEVPASSWORD', 'ROKU_SIGN_PASSWORD']);
const parser = new ArgumentParser({
description: 'Sign package'
});
parser.add_argument('--out-file', { help: 'A zip file to sign' });
parser.add_argument('--out-dir', { help: 'Folder of the zip file' });
parser.add_argument('--staging-dir', { help: 'Path to the staging directory' });
const args = parser.parse_args();
const outFile = args.out_file;
const outDir = args.out_dir;
const stagingDir = args.staging_dir;
const options = {
host: config.ROKU_DEV_TARGET,
packagePort: config.ROKU_DEV_TARGET_PORT || 80,
password: config.ROKU_DEVPASSWORD,
outDir: 'release',
outFile: 'playlet.zip',
outDir: outDir,
outFile: outFile,
failOnCompileError: true,
stagingDir: 'build/playlet-app',
stagingDir: stagingDir,
retainStagingDir: true,
signingPassword: config.ROKU_SIGN_PASSWORD,
};
-34
View File
@@ -1,34 +0,0 @@
// Description: pulls the release zip from github, signs it and retrieves it from the Roku device
const shell = require('shelljs');
if (!shell.which('git')) {
shell.echo('Sorry, this script requires git');
shell.exit(1);
}
shell.exec('git fetch --tags --force');
// get current commit hash
const gitCommitHash = shell.exec('git rev-parse HEAD').stdout.trim();
// get current tag
const gitTags = shell.exec(`git tag --contains ${gitCommitHash}`)
.stdout.trim()
.split('\n')
.map(tag => tag.trim());
const expectedGitTag = `v${require('../package.json').version}`;
if (gitTags.length === 0) {
console.error(`No git tag found. Signing anyway...`);
}
if (!gitTags.includes(expectedGitTag)) {
console.error(`Expected git tag ${expectedGitTag} but found [${gitTags.join(",")}]. Signing anyway...`);
}
// download playlet.zip from github
const zipUrl = `https://github.com/iBicha/playlet/releases/download/${expectedGitTag}/playlet.zip`
shell.exec(`curl --fail -L -o release/playlet.zip "${zipUrl}"`);
// sign the package
shell.exec('node tools/sign-package.js');
+41
View File
@@ -0,0 +1,41 @@
const shell = require('shelljs');
const { ArgumentParser } = require('argparse')
if (!shell.which('unzip')) {
shell.echo('Sorry, this script requires unzip');
shell.exit(1);
}
if (!shell.which('mksquashfs')) {
shell.echo('Sorry, this script requires mksquashfs');
shell.exit(1);
}
const parser = new ArgumentParser({
description: 'Convert a zip file to a squashfs file'
});
parser.add_argument('--in-file', { help: 'A zip file to squash' });
parser.add_argument('--out-file', { help: 'A squashfs file to create' });
const args = parser.parse_args();
const inFile = args.in_file;
const outFile = args.out_file;
const fs = require('fs');
const { execSync } = require('child_process');
// Create a temporary directory
const tempDir = fs.mkdtempSync('squash-fs-');
// Unzip the file
execSync(`unzip ${inFile} -d ${tempDir}`);
execSync(`mksquashfs ${tempDir} ${outFile} -force-uid 500 -force-gid 500 -comp zstd -b 32768 -Xcompression-level 22`);
// Remove the temporary directory
execSync(`rm -rf ${tempDir}`);
console.log(`Created squashfs file: ${outFile}`);
+7 -7
View File
@@ -12,18 +12,18 @@ if (!shell.which('git')) {
const gitStatus = shell.exec('git status --porcelain=v1');
if (gitStatus.stdout !== '') {
shell.echo('Found changed files. Aborting.');
shell.exit(1);
shell.echo('Found changed files. Aborting.');
shell.exit(1);
}
const gitCommitHash = shell.exec('git rev-parse HEAD').stdout.trim();
const gitCommitHash = shell.exec('git rev-parse --short HEAD').stdout.trim();
["playlet-app/src/manifest", "playlet-lib/src/manifest"].forEach(function (manifestPath) {
let appManifestContent = fs.readFileSync(manifestPath, { encoding: 'utf8', flag: 'r' });
let appManifestContent = fs.readFileSync(manifestPath, { encoding: 'utf8', flag: 'r' });
const gitHashPattern = /git_commit_sha=(\w+)/;
const gitHashPattern = /git_commit_sha=(\w+)/;
appManifestContent = appManifestContent.replace(gitHashPattern, `git_commit_sha=${gitCommitHash}`);
appManifestContent = appManifestContent.replace(gitHashPattern, `git_commit_sha=${gitCommitHash}`);
fs.writeFileSync(manifestPath, appManifestContent);
fs.writeFileSync(manifestPath, appManifestContent);
})