From 277b2775b550e485d4d78eaed1b8b056bd53b320 Mon Sep 17 00:00:00 2001 From: Enson Choy Date: Tue, 29 Aug 2023 12:52:19 -0700 Subject: [PATCH] doc+ci: Publish native BrightScript artifact --- .github/workflows/build.yaml | 21 +++++++- README.md | 92 +++++++++++++++++++++++++++--------- 2 files changed, 89 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index b44eeeb..6531c9b 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -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 \ No newline at end of file + 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 \ No newline at end of file diff --git a/README.md b/README.md index 072679d..61f8a97 100644 --- a/README.md +++ b/README.md @@ -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 + ``` +