build-npm #42
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v4 | |
- name: Get version from package.json | |
id: package_version | |
# uses: notiz-dev/github-action-json-property@release | |
uses: Srxzwei/[email protected] | |
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@v4 | |
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@v4 | |
with: | |
name: yarn.lock | |
path: yarn.lock | |
overwrite: true | |
retention-days: 5 |