Skip to content

Merge pull request #521 from Deeksha1502/online-ecml-fix #4

Merge pull request #521 from Deeksha1502/online-ecml-fix

Merge pull request #521 from Deeksha1502/online-ecml-fix #4

Workflow file for this run

name: Publish Content Player Package
on:
push:
tags:
- '*'
jobs:
build:
name: Build and Publish Content Player Package
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '10.16.3'
cache: 'npm'
- name: Restore node_modules cache
id: cache
uses: actions/cache@v4
with:
path: player/node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-modules-
- name: Configure git to use HTTPS
run: git config --global url."https://".insteadOf git://
- name: Install Python 2
run: |
sudo apt-get update
sudo apt-get install -y python2
sudo ln -sf /usr/bin/python2 /usr/bin/python
- name: Set npm python config
run: npm config set python /usr/bin/python2
- name: Install dependencies
working-directory: player
run: npm i --legacy-peer-deps
- name: Save node_modules cache
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/cache@v4
with:
path: player/node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
- name: Build preview
working-directory: player
run: npm run build-preview ekstep
- name: Compress preview
working-directory: player
run: grunt compress:preview
- name: Generate libs
working-directory: player
run: grunt generate-libs
- name: Build and publish package
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
npm run build-npm-package
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > ~/.npmrc
npm pack ./www/preview
npm publish project-sunbird-content-player-*