-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (63 loc) · 2.3 KB
/
build-npm.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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