-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: service modules, gh module support, more
This commit implements service modules, GitHub Module Support for fast development, moddable Tizen Application support, HTTP Proxy for application modules and a new Updater application.
- Loading branch information
Showing
33 changed files
with
1,947 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<profiles active="TizenBrew-New" version="3.1"> | ||
<profile name="TizenBrew-Old"> | ||
<profileitem ca="$GITHUB_WORKSPACE/tizen-studio/tools/certificate-generator/certificates/developer/tizen-developer-ca.cer" distributor="0" key="$GITHUB_WORKSPACE/tizen-studio-data/keystore/author/tizenbrew-author.p12" password="$KEY_PW" rootca=""/> | ||
<profileitem ca="$GITHUB_WORKSPACE/tizen-studio/tools/certificate-generator/certificates/distributor/sdk-partner/tizen-distributor-ca.cer" distributor="1" key="$GITHUB_WORKSPACE/tizen-studio/tools/certificate-generator/certificates/distributor/sdk-partner/tizen-distributor-signer.p12" password="tizenpkcs12passfordsigner" rootca=""/> | ||
<profileitem ca="" distributor="2" key="" password="" rootca=""/> | ||
</profile> | ||
<profile name="TizenBrew-New"> | ||
<profileitem ca="$GITHUB_WORKSPACE/tizen-studio/tools/certificate-generator/certificates/developer/tizen-developer-ca.cer" distributor="0" key="$GITHUB_WORKSPACE/tizen-studio-data/keystore/author/tizenbrew-author.p12" password="$KEY_PW" rootca=""/> | ||
<profileitem ca="$GITHUB_WORKSPACE/tizen-studio/tools/certificate-generator/certificates/distributor/sdk-partner/tizen-distributor-ca-new.cer" distributor="1" key="$GITHUB_WORKSPACE/tizen-studio/tools/certificate-generator/certificates/distributor/sdk-partner/tizen-distributor-signer-new.p12" password="tizenpkcs12passfordsigner" rootca=""/> | ||
<profileitem ca="" distributor="2" key="" password="" rootca=""/> | ||
</profile> | ||
</profiles> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ on: | |
- 'v*.*.*' | ||
|
||
env: | ||
TIZEN_STUDIO_VER: 4.5.1 | ||
TIZEN_STUDIO_VER: 5.6 | ||
|
||
jobs: | ||
build: | ||
|
@@ -18,7 +18,7 @@ jobs: | |
- name: Set env | ||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
|
||
- name: Install modules and build service | ||
- name: Install modules and build standalone service | ||
working-directory: tizenbrew-app/TizenBrew/service | ||
run: | | ||
sudo apt install -y expect zip | ||
|
@@ -28,6 +28,13 @@ jobs: | |
ncc build service.js | ||
rm -r node_modules | ||
- name: Install modules and build updater service | ||
working-directory: tizenbrew-updater/TizenBrewUpdater/service | ||
run: | | ||
npm install | ||
ncc build service.js | ||
rm -r node_modules | ||
- name: Download Tizen-Studio | ||
run: | | ||
curl -o tizen-installer "https://download.tizen.org/sdk/Installer/tizen-studio_${TIZEN_STUDIO_VER}/web-cli_Tizen_Studio_${TIZEN_STUDIO_VER}_ubuntu-64.bin" | ||
|
@@ -41,50 +48,107 @@ jobs: | |
- name: Prepare Tizen Certificate | ||
run: | | ||
./tizen-studio/tools/ide/bin/tizen certificate -a TizenBrew -p 1234 -c NZ -s Aukland -ct Aukland -o Tizen -n TizenBrew -e [email protected] -f tizencert | ||
./tizen-studio/tools/ide/bin/tizen security-profiles add -n TizenBrew -a "${GITHUB_WORKSPACE}/tizen-studio-data/keystore/author/tizencert.p12" -p 1234 | ||
${{ secrets.TIZEN_AUTHOR_KEY }} | base64 -d > "${GITHUB_WORKSPACE}/tizen-studio-data/keystore/author/tizenbrew-author.p12" | ||
./tizen-studio/tools/ide/bin/tizen cli-config "profiles.path=${GITHUB_WORKSPACE}/tizen-studio-data/profile/profiles.xml" | ||
cp .github/assets/profiles.xml "${GITHUB_WORKSPACE}/tizen-studio-data/profile/profiles.xml" | ||
sed -i "s|\$GITHUB_WORKSPACE|${GITHUB_WORKSPACE}|g" "${GITHUB_WORKSPACE}/tizen-studio-data/profile/profiles.xml" | ||
sed -i "s|\$KEY_PW|${{ secrets.TIZEN_AUTHOR_KEY_PW }}|g" "${GITHUB_WORKSPACE}/tizen-studio-data/profile/profiles.xml" | ||
chmod 755 "./tizen-studio-data/profile/profiles.xml" | ||
- name: Build | ||
- name: Build TizenBrew | ||
working-directory: tizenbrew-app/TizenBrew | ||
run: | | ||
${GITHUB_WORKSPACE}/tizen-studio/tools/ide/bin/tizen build-web -e ".*" -e "node_modules/*" -e "package*.json" -e "yarn.lock" | ||
- name: Prepare for password prompt | ||
- name: Build TizenBrew Updater | ||
working-directory: tizenbrew-updater/TizenBrewUpdater | ||
run: | | ||
sed -i "s|${GITHUB_WORKSPACE}/tizen-studio-data/keystore/author/tizencert.pwd|1234|g" ${GITHUB_WORKSPACE}/tizen-studio-data/profile/profiles.xml | ||
sed -i "s|${GITHUB_WORKSPACE}/tizen-studio-data/tools/certificate-generator/certificates/distributor/tizen-distributor-signer.pwd|tizenpkcs12passfordsigner|g" ${GITHUB_WORKSPACE}/tizen-studio-data/profile/profiles.xml | ||
sed -i 's|password=""|password="tizenpkcs12passfordsigner"|g' ${GITHUB_WORKSPACE}/tizen-studio-data/profile/profiles.xml | ||
- name: Package WGT | ||
${GITHUB_WORKSPACE}/tizen-studio/tools/ide/bin/tizen build-web -e ".*" -e "node_modules/*" -e "package*.json" -e "yarn.lock" | ||
- name: Package TizenBrew for Old Tizen | ||
env: | ||
PASSWORD: ${{ secrets.TIZEN_AUTHOR_KEY_PW }} | ||
APP_PATH: tizenbrew-app/TizenBrew | ||
CERT: TizenBrew-Old | ||
run: | | ||
expect ./package.exp | ||
mv tizenbrew-app/TizenBrew/release/TizenBrewStandalone.wgt tizenbrew-app/TizenBrew/release/TizenBrewStandalone-Old.wgt | ||
- name: Package TizenBrew for New Tizen | ||
env: | ||
PASSWORD: ${{ secrets.TIZEN_AUTHOR_KEY_PW }} | ||
APP_PATH: tizenbrew-app/TizenBrew | ||
CERT: TizenBrew-New | ||
run: | | ||
expect ./package.exp | ||
mv tizenbrew-app/TizenBrew/release/TizenBrewStandalone.wgt tizenbrew-app/TizenBrew/release/TizenBrewStandalone-New.wgt | ||
- name: Package TizenBrew Updater for Old Tizen | ||
env: | ||
PASSWORD: ${{ secrets.TIZEN_AUTHOR_KEY_PW }} | ||
APP_PATH: tizenbrew-updater/TizenBrewUpdater | ||
CERT: TizenBrew-Old | ||
run: | | ||
expect ./package.exp | ||
mv tizenbrew-updater/TizenBrewUpdater/release/TizenBrewUpdater.wgt tizenbrew-updater/TizenBrewUpdater/release/TizenBrewUpdater-Old.wgt | ||
- name: Package TizenBrew Updater for New Tizen | ||
env: | ||
PASSWORD: ${{ secrets.TIZEN_AUTHOR_KEY_PW }} | ||
APP_PATH: tizenbrew-updater/TizenBrewUpdater | ||
CERT: TizenBrew-New | ||
run: | | ||
expect ./package.exp | ||
mv tizenbrew-updater/TizenBrewUpdater/release/TizenBrewUpdater.wgt tizenbrew-updater/TizenBrewUpdater/release/TizenBrewUpdater-New.wgt | ||
- name: Package WGT as USB Demo Package | ||
- name: Package TizenBrew as USB Demo Package | ||
run: | | ||
wgt-to-usb tizenbrew-app/TizenBrew/release/TizenBrewStandalone.wgt | ||
wgt-to-usb tizenbrew-app/TizenBrew/release/TizenBrewStandalone-Old.wgt | ||
- name: Upload Tizen package artifact | ||
- name: Package Updater as USB Demo Package | ||
run: | | ||
wgt-to-usb tizenbrew-updater/TizenBrewUpdater/release/TizenBrewUpdater-Old.wgt | ||
- name: Upload TizenBrew package artifact for Old Tizen | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: app-${{ github.sha }}-old.wgt | ||
path: tizenbrew-app/TizenBrew/release/TizenBrewStandalone-Old.wgt | ||
|
||
- name: Upload TizenBrew package artifact for New Tizen | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: app-${{ github.sha }}.wgt | ||
path: tizenbrew-app/TizenBrew/release/TizenBrewStandalone.wgt | ||
name: app-${{ github.sha }}-new.wgt | ||
path: tizenbrew-app/TizenBrew/release/TizenBrewStandalone-New.wgt | ||
|
||
- name: Release Build Result | ||
uses: softprops/action-gh-release@v1 | ||
- name: Upload TizenBrew Updater package artifact for Old Tizen | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
tag_name: ${{ env.RELEASE_VERSION }} | ||
files: | | ||
tizenbrew-app/TizenBrew/release/TizenBrewStandalone.wgt | ||
name: updater-${{ github.sha }}-old.wgt | ||
path: tizenbrew-updater/TizenBrewUpdater/release/TizenBrewUpdater-Old.wgt | ||
|
||
- name: Upload TizenBrew Updater package artifact for New Tizen | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: updater-${{ github.sha }}-new.wgt | ||
path: tizenbrew-updater/TizenBrewUpdater/release/TizenBrewUpdater-New.wgt | ||
|
||
- name: Zip USB Demo Package | ||
run: | | ||
zip -r tizenbrew-app/TizenBrew/release/TizenBrewStandaloneUSBDemo.zip userwidget/ | ||
- name: Release USB Demo Package | ||
- name: Zip Updater USB Demo Package | ||
run: | | ||
zip -r tizenbrew-updater/TizenBrewUpdater/release/TizenBrewUpdaterUSBDemo.zip userwidget/ | ||
- name: Release TizenBrew Build Results | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
tag_name: ${{ env.RELEASE_VERSION }} | ||
files: | | ||
tizenbrew-app/TizenBrew/release/TizenBrewStandaloneUSBDemo.zip | ||
tizenbrew-app/TizenBrew/release/TizenBrewStandalone-Old.wgt | ||
tizenbrew-app/TizenBrew/release/TizenBrewStandalone-New.wgt | ||
tizenbrew-updater/TizenBrewUpdater/release/TizenBrewUpdater-Old.wgt | ||
tizenbrew-updater/TizenBrewUpdater/release/TizenBrewUpdater-New.wgt | ||
tizenbrew-app/TizenBrew/release/TizenBrewStandaloneUSBDemo.zip | ||
tizenbrew-updater/TizenBrewUpdater/release/TizenBrewUpdaterUSBDemo.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,42 @@ | ||
# Making a module | ||
# Creating modules for TizenBrew | ||
|
||
There are two types of modules: apps and mods. The modules are normal NPM modules, but they only have files for the app or mods. | ||
There are three types of modules: applications, site modifications and services. The modules itself are normal NPM/Node modules but special. | ||
|
||
## Package.json format | ||
## Application Modules | ||
|
||
The format is pretty same as a normal package.json file, but with some differences. There are some properties that are required for the module to work. | ||
Application modules are simply web pages without any modifications. They are not installed on the TV, but are served from a server. The module should contain a `package.json` file with the following properties: | ||
|
||
`packageType`: The type of the module. Can be `app` or `mods`. Required. | ||
- `packageType`: The type of the module. Should be `app`. | ||
- `appName`: The name of the module (user friendly, like "TizenTube"). | ||
- `appPath`: The path to the index.html file. (like `app/index.html`) | ||
- `keys`: The keys that should be registered using the [TVInputDevice](https://developer.samsung.com/smarttv/develop/api-references/tizen-web-device-api-references/tvinputdevice-api.html) API. | ||
|
||
`appName`: The name of the module (user friendly, like "TizenTube"). Required. | ||
## Site Modification Modules | ||
|
||
`appPath`: The path to the app folder. Required if `packageType` is `app`. | ||
Site modification modules are basically the same as application modules, but they are used to modify a website. The modifications are basically JavaScript code that is injected into a website. The module should contain a `package.json` file with the following properties: | ||
|
||
`websiteURL`: The URL of the website. Required if `packageType` is `mods`. | ||
- `packageType`: The type of the module. Should be `mods` | ||
- `appName`: The name of the module (user friendly, like "TizenTube"). | ||
- `websiteURL`: The URL of the website. | ||
- `main`: The JavaScript file to be injected to the website. | ||
- `keys`: The keys that should be registered using the [TVInputDevice](https://developer.samsung.com/smarttv/develop/api-references/tizen-web-device-api-references/tvinputdevice-api.html) API. | ||
- `tizenAppId`: The Tizen application ID of the application that should be modified. Will be used if it exists. | ||
|
||
`main`: The main file of the mods module. Required if `packageType` is `mods`. | ||
## Service Modules | ||
|
||
`keys`: The keys that should be registered using the [TVInputDevice](https://developer.samsung.com/smarttv/develop/api-references/tizen-web-device-api-references/tvinputdevice-api.html) API. Not required. | ||
Service modules are ran in the background using Node.js. They can be used to interact with the TV in the background. | ||
|
||
Here's an example mods module: | ||
```json | ||
{ | ||
"name": "@foxreis/tizentube", | ||
"appName": "TizenTube", | ||
"version": "1.0.0", | ||
"description": "TizenTube is an ad-free and sponsor-free solution for your favourite streaming website on your Tizen (Samsung) TVs.", | ||
"main": "userScript.js", | ||
"packageType": "mods", | ||
"websiteURL": "https://example.com" | ||
} | ||
``` | ||
Service modules is also an application module, but with a special property called `serviceFile`. This property should contain the path to the main JavaScript file of the service. | ||
|
||
The module should contain a `package.json` file with the following properties: | ||
|
||
- `packageType`: The type of the module. Should be `service`. | ||
- `appName`: The name of the module (user friendly, like "TizenTube"). | ||
- `serviceFile`: The main JavaScript file of the service. | ||
- `appPath`: The path to the index.html file. (like `app/index.html`) | ||
- `keys`: The keys that should be registered using the [TVInputDevice](https://developer.samsung.com/smarttv/develop/api-references/tizen-web-device-api-references/tvinputdevice-api.html) API. | ||
|
||
|
||
## Examples | ||
|
||
See [TizenTube](https://github.com/reisxd/TizenTube) for an example of an site modification module and [Jellyfin-Tizen](https://github.com/GlenLowland/jellyfin-tizen-npm-publish) for an example of an application module. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,6 @@ | |
</platforms> | ||
<package> | ||
<blacklist/> | ||
<resFallback autoGen="true"/> | ||
</package> | ||
</tproject> |
Oops, something went wrong.