diff --git a/.github/workflows/release-package.yml b/.github/workflows/release-package.yml new file mode 100644 index 00000000000..a1069d92aa0 --- /dev/null +++ b/.github/workflows/release-package.yml @@ -0,0 +1,42 @@ +name: Node.js Package + +on: + release: + types: + - created + +jobs: + publish: + + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + dirName: ['dsbridge', 'hls.js', 'viewport-units-buggyfill', 'anonymous-token'] + + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-node@v1 + with: + node-version: 16 + registry-url: 'https://npm.pkg.github.com' + scope: '@adrise' + + - run: npm set-script prepare "" + if: ${{ matrix.dirName == 'hls.js' }} # currently only hls.js has the husky config + working-directory: packages/${{ matrix.dirName }} + + - run: npm install ci --legacy-peer-deps + if: ${{ matrix.dirName == 'hls.js' || matrix.dirName == 'anonymous-token' }} # currently only hls.js and anonymous-token migrated the build command + working-directory: packages/${{ matrix.dirName }} + + - run: npm run build + if: ${{ matrix.dirName == 'hls.js' || matrix.dirName == 'anonymous-token' }} # currently only hls.js and anonymous-token migrated the build command + working-directory: packages/${{ matrix.dirName }} + + - run: npm publish + working-directory: packages/${{ matrix.dirName }} + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}