Skip to content

build-npm

build-npm #27

Workflow file for this run

name: build-npm
# NODEJS_VERSION: string; The relevant Node.js version.
# '18'
#
# FOLIO_NPM_REGISTRY: string: The registry from which to get FOLIO and ReShare dependencies.
# 'https://repository.folio.org/repository/npm-folioci/'
env:
NODEJS_VERSION: '18'
FOLIO_NPM_REGISTRY: 'https://repository.folio.org/repository/npm-folioci/'
COMPILE_TRANSLATION_FILES: true
on:
workflow_dispatch:
jobs:
build-npm:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Get version from package.json
id: package_version
uses: notiz-dev/github-action-json-property@release
with:
path: 'package.json'
prop_path: 'version'
- name: Gather some variables
run: |
echo "PACKAGE_VERSION=${{ steps.package_version.outputs.prop }}" >> $GITHUB_ENV
echo "DEFAULT_BRANCH=${{ github.event.repository.default_branch }}" >> $GITHUB_ENV
- name: Report some variables
run: |
echo "PACKAGE_VERSION=${{ env.PACKAGE_VERSION }}"
echo "github.REF=${{ github.REF }}"
echo "DEFAULT_BRANCH=${{ env.DEFAULT_BRANCH }}"
- name: Setup kernel for react native, increase watchers
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODEJS_VERSION }}
check-latest: true
always-auth: true
- name: Set yarn config
run: yarn config set @folio:registry $FOLIO_NPM_REGISTRY
- name: Run yarn install
run: yarn install --ignore-scripts
- name: Run yarn list of modules
run: yarn list --pattern "@folio|@reshare|@indexdata"
- name: Run yarn lint
run: yarn lint
continue-on-error: true
- name: Run yarn formatjs-compile
if: ${{ env.COMPILE_TRANSLATION_FILES == 'true' }}
run: yarn formatjs-compile
- name: Generate FOLIO module descriptor
run: yarn build-mod-descriptor
- name: Print FOLIO module descriptor
run: cat module-descriptor.json
- name: Publish yarn.lock
uses: actions/upload-artifact@v3
with:
name: yarn.lock
path: yarn.lock
retention-days: 5