Skip to content

Commit

Permalink
(chore) Upgrade Yarn and switch to workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
denniskigen committed Nov 17, 2023
1 parent cef0d8a commit 0ba2a4a
Show file tree
Hide file tree
Showing 8 changed files with 6,091 additions and 9,380 deletions.
49 changes: 23 additions & 26 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "16"
node-version: "18"

- name: Cache dependencies
id: cache
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "16"
node-version: "18"
registry-url: "https://registry.npmjs.org"

- name: Cache dependencies
Expand All @@ -74,40 +74,22 @@ jobs:

- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn
run: yarn install --immutable

- name: Build
run: yarn turbo build --color

- name: Patch
run: yarn lerna version patch --no-git-tag-version --no-push --yes

- name: Version
run: yarn lerna version "$(node -e "console.log(require('./lerna.json').version)")-pre.${{ github.run_number }}" --no-git-tag-version --yes
run: yarn workspaces foreach --worktree --topological --exclude @openmrs/esm-home version "$(node -e "console.log(require('semver').inc(require('./package.json').version, 'patch'))")-pre.${{ github.run_number }}"

- run: git config user.email "[email protected]" && git config user.name "OpenMRS CI"
- run: git add . && git commit -m "Prerelease version" --no-verify

- name: Pre-release
run: yarn run ci:prepublish
run: yarn config set npmAuthToken "${NODE_AUTH_TOKEN}" && yarn run ci:prepublish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

deploy_home_page:
runs-on: ubuntu-latest

needs: pre_release

if: ${{ github.event_name == 'push' }}

steps:
- name: Trigger RefApp Build
uses: fjogeleit/http-request-action@master
with:
url: https://ci.openmrs.org/rest/api/latest/queue/REFAPP-D3X
method: "POST"
customHeaders: '{ "Authorization": "Bearer ${{ secrets.BAMBOO_TOKEN }}" }'

release:
runs-on: ubuntu-latest

Expand All @@ -120,7 +102,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "16"
node-version: "18"
registry-url: "https://registry.npmjs.org"

- name: Cache dependencies
Expand All @@ -132,12 +114,27 @@ jobs:

- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npx lerna bootstrap
run: yarn install --immutable

- name: Build
run: yarn turbo build --color

- name: Publish
run: yarn run ci:publish
run: yarn config set npmAuthToken "${NODE_AUTH_TOKEN}" && yarn run ci:publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

deploy_home_page:
runs-on: ubuntu-latest

needs: pre_release

if: ${{ github.event_name == 'push' }}

steps:
- name: Trigger RefApp Build
uses: fjogeleit/http-request-action@master
with:
url: https://ci.openmrs.org/rest/api/latest/queue/REFAPP-D3X
method: "POST"
customHeaders: '{ "Authorization": "Bearer ${{ secrets.BAMBOO_TOKEN }}" }'
541 changes: 0 additions & 541 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

This file was deleted.

550 changes: 0 additions & 550 deletions .yarn/plugins/@yarnpkg/plugin-version.cjs

This file was deleted.

874 changes: 0 additions & 874 deletions .yarn/releases/yarn-3.6.3.cjs

This file was deleted.

893 changes: 893 additions & 0 deletions .yarn/releases/yarn-4.0.2.cjs

Large diffs are not rendered by default.

12 changes: 5 additions & 7 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
nodeLinker: node-modules
compressionLevel: mixed

enableGlobalCache: false

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"
- path: .yarn/plugins/@yarnpkg/plugin-version.cjs
spec: "@yarnpkg/plugin-version"
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-3.6.3.cjs
yarnPath: .yarn/releases/yarn-4.0.2.cjs
10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
"*.{js,jsx,ts,tsx}": "eslint --cache --fix"
},
"scripts": {
"ci:publish": "lerna publish from-package --yes",
"ci:prepublish": "lerna publish from-package --no-git-reset --yes --dist-tag next",
"ci:release": "lerna version --no-git-tag-version",
"ci:prerelease": "lerna version prerelease --no-git-tag-version --yes",
"ci:publish": "yarn workspaces foreach --all --topological --exclude @openmrs-esm-home npm publish --access public --tag latest",
"ci:prepublish": "yarn workspaces foreach --all --topological --exclude @openmrs/esm-home npm publish --access public --tag next",
"ci:release": "yarn workspaces foreach --all --topological version",
"prettier": "prettier --config prettier.config.js --write \"packages/**/*.{ts,tsx}\"",
"postinstall": "husky install",
"start": "openmrs develop --sources 'packages/esm-*-app/'",
Expand Down Expand Up @@ -48,7 +47,6 @@
"jest": "^29.7.0",
"jest-cli": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"lerna": "^7.2.0",
"lint-staged": "^14.0.1",
"openmrs": "next",
"prettier": "^3.0.3",
Expand All @@ -64,5 +62,5 @@
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4"
},
"packageManager": "yarn@3.6.3"
"packageManager": "yarn@4.0.2"
}
Loading

0 comments on commit 0ba2a4a

Please sign in to comment.