Skip to content

Commit

Permalink
doc+ci: Publish native BrightScript artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
echoy-harmonicinc committed Aug 29, 2023
1 parent 3d9ac89 commit 277b277
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 24 deletions.
21 changes: 20 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,23 @@ jobs:
run: |
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ./.npmrc
npm version ${{env.RELEASE_VERSION}} --no-git-tag-version
npm publish --access public
npm publish --access public
publish-brs:
#only run this task for version-tagged releases
if: startsWith(github.ref, 'refs/tags/v')
needs: ci
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build
working-directory: ./lib
run: |
npm run build
tar -zcf out/hlit-rafx-ssai-brs.tar.gz out/.roku-deploy-staging
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: lib/out/hlit-rafx-ssai-brs.tar.gz
tag: ${{ github.ref }}
overwrite: true
92 changes: 69 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,71 @@
# Harmonic RAFX SSAI adapter

## Prerequisites
This adapter is written in [BrighterScript](https://github.com/rokucommunity/brighterscript). Install it globally by running
```
npm install brighterscript -g
```
Or install it locally in your Roku app package repository
```
npm install brighterscript --save-dev
```
Transpiling prior to building your Roku app is required.
```
bsc
```

## Installation
### ropm (highly recommended)
[ropm](https://github.com/rokucommunity/ropm) package manager is supported. Install it by
```
ropm install @harmonicinc/vos_roku_rafx_ssai
```
### ropm & BrighterScript (highly recommended)
1. [ropm](https://github.com/rokucommunity/ropm) package manager is supported. Install it by
```
ropm install @harmonicinc/vos_roku_rafx_ssai
```
1. Create a new player task. It should be launched by another UI logic script.
1. Import required libraries in your BrighterScript file
```
import "pkg:/source/roku_modules/harmonicinc_vos_roku_rafx_ssai/ssai.bs"
library "Roku_Ads.brs"
```

### Manual install
Copy the whole `source` folder to your project's `source` folder
Install [roku-requests](https://github.com/rokucommunity/roku-requests) by following the README at the link above
1. Copy source files

> Choose one below
**1a. With BrighterScript**

Copy the whole `source` folder to your project's `source` folder

Install [roku-requests](https://github.com/rokucommunity/roku-requests) by following the README in that repo

**1b. With native BrightScript**

Transpiled BrightScript files are provided in Release as artifact `hlit-rafx-ssai-brs.tar.gz` if you're unable to use BrighterScript. Copy those files in the zip instead of the source files in the repo to your app.

Dependencies are included, so there's no need to install them separately.

## Usage
1. Create a new player task. It should be launched by another UI logic script.
1. Import required libraries

**3a. If you're using BrighterScript**

Import required libraries in your BrighterScript file
```
import "pkg:/source/roku_modules/harmonicinc_vos_roku_rafx_ssai/ssai.bs"
library "Roku_Ads.brs"
```

**3b. If you're using native BrightScript**

In the task component XML, import required libraries
```
<script type="text/brightscript" uri="pkg:/source/roku_modules/harmonicinc_vos_roku_rafx_ssai/SSAI.brs" />
<script type="text/brightscript" uri="pkg:/source/roku_modules/rokurequests_v1/Requests.brs" />
<script type="text/brightscript" uri="pkg:/source/roku_modules/harmonicinc_vos_roku_rafx_ssai/PodHelper.brs" />
<script type="text/brightscript" uri="pkg:/source/roku_modules/harmonicinc_vos_roku_rafx_ssai/MetadataParser.brs" />
<script type="text/brightscript" uri="pkg:/source/roku_modules/harmonicinc_vos_roku_rafx_ssai/DashParser.brs" />
<script type="text/brightscript" uri="pkg:/source/bslib.brs" />
```

Import Roku RAF library in your BrightScript file
```
library "Roku_Ads.brs"
```


## Usage
1. Create Harmonic RAFX adapter by
```
adapter = new harmonic.rafx.ssai.RAFX_SSAI()
' If you're using native BrightScript:
adapter = harmonicinc_vos_roku_rafx_ssai_RAFX_SSAI()
```
1. Provide the stream URL to the adapter
```
Expand Down Expand Up @@ -91,7 +122,22 @@ Install [roku-requests](https://github.com/rokucommunity/roku-requests) by follo
m.top.video.unobserveFieldScoped("state")
```

## Example app tryout
## Development
### Prerequisites
This adapter is written in [BrighterScript](https://github.com/rokucommunity/brighterscript). Install it globally by running
```
npm install brighterscript -g
```
Or install it locally in your Roku app package repository
```
npm install brighterscript --save-dev
```
Transpiling prior to building your Roku app is required.
```
bsc
```

### Example app tryout
Example app is included in `/demo` for reference. Demo depends on local SDK instead of the one on npm.

ropm packager is required. Install it globally by
Expand Down

0 comments on commit 277b277

Please sign in to comment.