Skip to content

Commit

Permalink
Updating ohri esms to publish (npmjs) a package tagged for staging en…
Browse files Browse the repository at this point in the history
…v, This tag comes from the current state of the branch
  • Loading branch information
Amos Laboso committed Jun 14, 2024
1 parent f583e23 commit 9dc5584
Show file tree
Hide file tree
Showing 3 changed files with 127 additions and 43 deletions.
84 changes: 82 additions & 2 deletions .github/workflows/node.working.js.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: OHRI CI - @esm and Docker Image
name: OHRI CI - @esm and Docker Image Working/QA

on:
push:
Expand All @@ -11,8 +11,88 @@ on:
types: [opened, synchronize]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '18'

- name: Cache dependencies
id: cache
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}

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

- name: Run tests
run: yarn run test

- name: Run build
run: yarn turbo run build --color --concurrency=5 --api="http://127.0.0.1:9080" --token="${{ secrets.TURBO_SERVER_TOKEN }}" --team="${{ github.repository_owner }}"

- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: packages
path: |
packages/**/dist
qa:
runs-on: ubuntu-latest
needs: build

if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/working' }}

steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org'

- name: Cache dependencies
id: cache
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install --immutable

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

- name: Build
run: yarn turbo run build --color --concurrency=5

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

- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: packages
path: |
packages/**/dist
docker_workingserver_frontend:
runs-on: ubuntu-latest
needs: qa

steps:
- name: Wait for 5 min - Let @esms reflect on NPM registry
Expand All @@ -37,7 +117,7 @@ jobs:
file: ./frontend/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ secrets.DOCKERHUB_USERNAME }}/ohri-working-frontend:next,${{ secrets.DOCKERHUB_USERNAME }}/ohri-working-frontend:ci_${{ github.run_number }}
tags: ${{ secrets.DOCKERHUB_USERNAME }}/ohri-working-frontend:qa,${{ secrets.DOCKERHUB_USERNAME }}/ohri-working-frontend:ci_${{ github.run_number }}
cache-from: type=inline,ref=user/app:buildcache
cache-to: type=inline,ref=user/app:buildcache,mode=max

Expand Down
85 changes: 44 additions & 41 deletions frontend/spa-build-config.json
Original file line number Diff line number Diff line change
@@ -1,46 +1,49 @@
{
"frontendModules": {
"@openmrs/esm-devtools-app": "5.3.3-pre.1301",
"@openmrs/esm-implementer-tools-app": "5.3.3-pre.1301",
"@openmrs/esm-login-app": "5.3.3-pre.1301",
"@openmrs/esm-primary-navigation-app": "5.3.3-pre.1301",
"@openmrs/esm-home-app": "5.2.1-pre.305",
"@openmrs/esm-form-entry-app": "6.1.1-pre.3293",
"@openmrs/esm-generic-patient-widgets-app": "6.1.1-pre.3293",
"@openmrs/esm-patient-allergies-app": "6.1.1-pre.3293",
"@openmrs/esm-patient-appointments-app": "6.1.1-pre.3293",
"@openmrs/esm-patient-attachments-app": "6.1.1-pre.3293",
"@openmrs/esm-patient-banner-app": "6.1.1-pre.3293",
"@openmrs/esm-patient-chart-app": "6.1.1-pre.3293",
"@openmrs/esm-patient-conditions-app": "6.1.1-pre.3293",
"@openmrs/esm-patient-forms-app": "6.1.1-pre.3293",
"@openmrs/esm-patient-flags-app": "6.1.1-pre.3293",
"@openmrs/esm-patient-labs-app": "6.1.1-pre.3293",
"@openmrs/esm-patient-lists-app": "6.1.1-pre.3293",
"@openmrs/esm-patient-medications-app": "6.1.1-pre.3293",
"@openmrs/esm-patient-notes-app": "6.1.1-pre.3293",
"@openmrs/esm-patient-orders-app": "6.1.1-pre.3293",
"@openmrs/esm-patient-programs-app": "6.1.1-pre.3293",
"@openmrs/esm-patient-vitals-app": "6.1.1-pre.3293",
"@openmrs/esm-active-visits-app": "5.2.2-pre.2432",
"@openmrs/esm-appointments-app": "5.2.2-pre.2432",
"@openmrs/esm-service-queues-app": "5.2.2-pre.2432",
"@openmrs/esm-patient-list-management-app": "5.2.2-pre.2432",
"@openmrs/esm-patient-registration-app": "5.2.2-pre.2432",
"@openmrs/esm-patient-search-app": "5.2.2-pre.2432",
"@openmrs/esm-openconceptlab-app": "4.0.2-pre.88",
"@openmrs/esm-system-admin-app": "4.0.2-pre.88",
"@openmrs/esm-dispensing-app": "1.2.2-pre.256",
"@openmrs/esm-fast-data-entry-app": "1.0.1-pre.117",
"@openmrs/esm-cohort-builder-app": "3.0.1-pre.183",
"@openmrs/esm-form-builder-app": "2.2.2-pre.654",
"@ohri/openmrs-esm-ohri-core-app": "2.1.0-pre.3192",
"@ohri/openmrs-esm-ohri-hiv-app": "2.1.0-pre.3192",
"@ohri/openmrs-esm-ohri-covid-app": "2.1.0-pre.3192",
"@ohri/openmrs-esm-ohri-pmtct": "2.1.0-pre.3192",
"@ohri/openmrs-esm-ohri-tb-app": "2.1.0-pre.3192",
"@ohri/openmrs-esm-ohri-cervical-cancer-app": "2.1.0-pre.3192",
"@ohri/openmrs-esm-ohri-form-render-app": "2.1.0-pre.3192"
"@openmrs/esm-devtools-app": "next",
"@openmrs/esm-implementer-tools-app": "next",
"@openmrs/esm-login-app": "next",
"@openmrs/esm-primary-navigation-app": "next",
"@openmrs/esm-home-app": "next",
"@openmrs/esm-form-engine-app": "next",
"@openmrs/esm-generic-patient-widgets-app": "next",
"@openmrs/esm-patient-allergies-app": "next",
"@openmrs/esm-patient-attachments-app": "next",
"@openmrs/esm-patient-banner-app": "next",
"@ohri/esm-patient-chart-app": "next",
"@openmrs/esm-patient-conditions-app": "next",
"@openmrs/esm-patient-forms-app": "next",
"@openmrs/esm-patient-flags-app": "next",
"@openmrs/esm-patient-labs-app": "next",
"@openmrs/esm-patient-lists-app": "next",
"@openmrs/esm-patient-medications-app": "next",
"@openmrs/esm-patient-notes-app": "next",
"@openmrs/esm-patient-orders-app": "next",
"@openmrs/esm-patient-programs-app": "next",
"@openmrs/esm-patient-vitals-app": "next",
"@openmrs/esm-active-visits-app": "next",
"@openmrs/esm-appointments-app": "next",
"@openmrs/esm-service-queues-app": "next",
"@openmrs/esm-patient-list-management-app": "next",
"@openmrs/esm-patient-registration-app": "next",
"@openmrs/esm-patient-search-app": "next",
"@openmrs/esm-openconceptlab-app": "next",
"@openmrs/esm-system-admin-app": "next",
"@openmrs/esm-dispensing-app": "next",
"@openmrs/esm-fast-data-entry-app": "next",
"@openmrs/esm-cohort-builder-app": "next",
"@ohri/openmrs-esm-ohri-core-app": "qa",
"@ohri/openmrs-esm-ohri-hiv-care-treatment-app": "qa",
"@ohri/openmrs-esm-ohri-hiv-prevention-app": "qa",
"@ohri/openmrs-esm-ohri-covid-app": "qa",
"@ohri/openmrs-esm-ohri-pmtct-app": "qa",
"@ohri/openmrs-esm-ohri-tb-app": "qa",
"@ohri/openmrs-esm-ohri-cervical-cancer-app": "qa",
"@ohri/openmrs-esm-ohri-form-render-app": "qa",
"@openmrs/esm-stock-management-app": "next",
"@openmrs/esm-billing-app": "next",
"@ohri/openmrs-esm-ohri-opd-app": "qa",
"@openmrs/esm-form-builder-app": "next"
},
"spaPath": "$SPA_PATH",
"apiUrl": "$API_URL",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"verify": "turbo run lint && turbo run typescript && yarn test --coverage",
"ci:prepublish": "yarn workspaces foreach --all --topological --exclude @ohri/openmrs-esm-ohri npm publish --access public --tag next",
"ci:publish": "yarn workspaces foreach --all --topological --exclude @ohri/openmrs-esm-ohri npm publish --access public --tag latest",
"ci:qa": "yarn workspaces foreach --all --topological --exclude @ohri/openmrs-esm-ohri npm publish --access public --tag qa",
"release": "yarn workspaces foreach --all --topological version",
"coverage": "yarn test --coverage",
"badges": "yarn coverage && yarn jest-coverage-badges --output './badges' ",
Expand Down

0 comments on commit 9dc5584

Please sign in to comment.