From 698a4011760651fe7d023a03b06864e798b51054 Mon Sep 17 00:00:00 2001 From: Pius Rubangakene Date: Thu, 31 Aug 2023 10:58:50 +0300 Subject: [PATCH] Pre-release CI fixes (#105) * version 1.0.2 * wip * adds ci-test to hooks * clean up * renames branch name --- .github/workflows/node.js.yml | 75 ++++++++++++-------- lerna.json | 2 +- packages/esm-family-health-app/package.json | 2 +- packages/esm-hiv-app/package.json | 2 +- packages/esm-ipd-app/package.json | 2 +- packages/esm-outpatient-app/package.json | 2 +- packages/esm-patient-queues-app/package.json | 2 +- packages/esm-radiology-app/package.json | 2 +- packages/esm-tb-app/package.json | 2 +- packages/esm-theatre-app/package.json | 2 +- packages/esm-ugandaemr-app/package.json | 2 +- 11 files changed, 55 insertions(+), 40 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index ebb1d3c6..13486910 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -9,48 +9,47 @@ on: types: - created +env: + TURBO_API: 'http://127.0.0.1:9080' + TURBO_TOKEN: ${{ secrets.TURBO_SERVER_TOKEN }} + TURBO_TEAM: ${{ github.repository_owner }} + jobs: build: runs-on: ubuntu-latest - env: - TURBO_API: 'http://127.0.0.1:9080' - TURBO_TOKEN: ${{ secrets.TURBO_SERVER_TOKEN }} - TURBO_TEAM: ${{ github.repository_owner }} + permissions: + actions: read steps: - uses: actions/checkout@v3 - name: Use Node.js uses: actions/setup-node@v3 with: - node-version: "18.x" - - registry-url: "https://registry.npmjs.org" + node-version: '16' - name: Cache dependencies id: cache uses: actions/cache@v3 with: - path: "**/node_modules" + path: '**/node_modules' key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} - name: Install dependencies if: steps.cache.outputs.cache-hit != 'true' run: yarn install --immutable - - name: Setup local cache server for Turborepo + - name: Setup a local cache server for Turborepo uses: felixmosh/turborepo-gh-artifacts@v2 with: repo-token: ${{ secrets.GITHUB_TOKEN }} - server-token: ${{ secrets.TURBO_SERVER_TOKEN }} + server-token: ${{ env.TURBO_TOKEN }} - - run: yarn verify - - run: yarn turbo build --color --concurrency=5 - - name: Upload Artifacts - uses: actions/upload-artifact@v3 - with: - name: packages - path: | - packages/**/dist + + - name: Run lint, type checks and tests + run: yarn verify + + - name: Run build + run: yarn turbo build --color --concurrency=5 pre_release: runs-on: ubuntu-latest @@ -61,16 +60,17 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Download Artifacts - uses: actions/download-artifact@v2 - name: Use Node.js uses: actions/setup-node@v3 + with: + node-version: '16' + registry-url: "https://registry.npmjs.org" - name: Cache dependencies id: cache uses: actions/cache@v3 with: - path: "**/node_modules" + path: '**/node_modules' key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} - name: Install dependencies @@ -81,13 +81,13 @@ jobs: uses: felixmosh/turborepo-gh-artifacts@v2 with: repo-token: ${{ secrets.GITHUB_TOKEN }} - server-token: ${{ secrets.TURBO_SERVER_TOKEN }} + server-token: ${{ env.TURBO_TOKEN }} - name: Version - run: yarn lerna version "$(node -e "console.log(require('semver').inc(require('./lerna.json').version, 'patch'))")-pre.${{ github.run_number }}" --yes + run: yarn lerna version "$(node -e "console.log(require('semver').inc(require('./lerna.json').version, 'patch'))")-pre.${{ github.run_number }}" --no-git-tag-version --no-push --yes - name: Build - run: yarn turbo run build --color --concurrency=5 + run: yarn turbo build --color --concurrency=5 - run: git config user.email "<>" && git config user.name "UgandaEMR CI" - run: git add . && git commit -m "Prerelease version" --no-verify @@ -97,6 +97,14 @@ jobs: env: NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} + - name: Upload build artifacts + uses: actions/upload-artifact@v3 + with: + name: packages + path: | + packages/**/dist + + release: runs-on: ubuntu-latest @@ -106,13 +114,11 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Download Artifacts - uses: actions/download-artifact@v3 - name: Use Node.js uses: actions/setup-node@v3 with: - node-version: "18.x" - registry-url: 'https://registry.npmjs.org' + node-version: '16' + registry-url: "https://registry.npmjs.org" - name: Cache dependencies id: cache @@ -125,7 +131,16 @@ jobs: if: steps.cache.outputs.cache-hit != 'true' run: yarn install --immutable - - run: yarn turbo run build --color - - run: yarn run ci:publish + - name: Setup local cache server for Turborepo + uses: felixmosh/turborepo-gh-artifacts@v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + server-token: ${{ env.TURBO_TOKEN }} + + - name: Build + run: yarn turbo build --color --concurrency=5 + + - name: Publish + run: yarn run ci:publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} diff --git a/lerna.json b/lerna.json index c7c74c33..5c0ec67a 100644 --- a/lerna.json +++ b/lerna.json @@ -4,7 +4,7 @@ ], "npmClient": "yarn", "useWorkspaces": true, - "version": "1.0.1", + "version": "1.0.2", "command": { "publish": { "verifyAccess": false diff --git a/packages/esm-family-health-app/package.json b/packages/esm-family-health-app/package.json index 40b03e14..a13af765 100644 --- a/packages/esm-family-health-app/package.json +++ b/packages/esm-family-health-app/package.json @@ -1,6 +1,6 @@ { "name": "@ugandaemr/esm-family-health-app", - "version": "1.0.1", + "version": "1.0.2", "license": "MPL-2.0", "description": "Family health microfrontend for UgandaEMR", "browser": "dist/esm-family-health-app.js", diff --git a/packages/esm-hiv-app/package.json b/packages/esm-hiv-app/package.json index 253e217b..cd60d288 100644 --- a/packages/esm-hiv-app/package.json +++ b/packages/esm-hiv-app/package.json @@ -1,6 +1,6 @@ { "name": "@ugandaemr/esm-hiv-app", - "version": "1.0.1", + "version": "1.0.2", "license": "MPL-2.0", "description": "HIV microfrontend for UgandaEMR", "browser": "dist/esm-hiv-app.js", diff --git a/packages/esm-ipd-app/package.json b/packages/esm-ipd-app/package.json index d6442d51..caecff77 100644 --- a/packages/esm-ipd-app/package.json +++ b/packages/esm-ipd-app/package.json @@ -1,6 +1,6 @@ { "name": "@ugandaemr/esm-inpatient-app", - "version": "1.0.1", + "version": "1.0.2", "license": "MPL-2.0", "description": "Inpatient department microfrontend for UgandaEMR", "browser": "dist/esm-inpatient-app.js", diff --git a/packages/esm-outpatient-app/package.json b/packages/esm-outpatient-app/package.json index 021af6cb..2c7c13fe 100644 --- a/packages/esm-outpatient-app/package.json +++ b/packages/esm-outpatient-app/package.json @@ -1,6 +1,6 @@ { "name": "@ugandaemr/esm-outpatient-app", - "version": "1.0.1", + "version": "1.0.2", "license": "MPL-2.0", "description": "Outpatient microfrontend for UgandaEMR", "browser": "dist/esm-outpatient-app.js", diff --git a/packages/esm-patient-queues-app/package.json b/packages/esm-patient-queues-app/package.json index a6b80290..c51a7dac 100644 --- a/packages/esm-patient-queues-app/package.json +++ b/packages/esm-patient-queues-app/package.json @@ -1,6 +1,6 @@ { "name": "@ugandaemr/esm-patient-queues-app", - "version": "1.0.1", + "version": "1.0.2", "license": "MPL-2.0", "description": "Patient queues microfrontend for UgandaEMR", "browser": "dist/esm-patient-queues-app.js", diff --git a/packages/esm-radiology-app/package.json b/packages/esm-radiology-app/package.json index 61bfc170..71be2320 100644 --- a/packages/esm-radiology-app/package.json +++ b/packages/esm-radiology-app/package.json @@ -1,6 +1,6 @@ { "name": "@ugandaemr/esm-radiology-app", - "version": "1.0.1", + "version": "1.0.2", "license": "MPL-2.0", "description": "Radiology microfrontend for UgandaEMR", "browser": "dist/esm-radiology-app.js", diff --git a/packages/esm-tb-app/package.json b/packages/esm-tb-app/package.json index 448f6638..954144b3 100644 --- a/packages/esm-tb-app/package.json +++ b/packages/esm-tb-app/package.json @@ -1,6 +1,6 @@ { "name": "@ugandaemr/esm-tb-app", - "version": "1.0.1", + "version": "1.0.2", "license": "MPL-2.0", "description": "tb microfrontend for UgandaEMR", "browser": "dist/esm-tb-app.js", diff --git a/packages/esm-theatre-app/package.json b/packages/esm-theatre-app/package.json index 940ccef6..294032e8 100644 --- a/packages/esm-theatre-app/package.json +++ b/packages/esm-theatre-app/package.json @@ -1,6 +1,6 @@ { "name": "@ugandaemr/esm-theatre-app", - "version": "1.0.1", + "version": "1.0.2", "license": "MPL-2.0", "description": "Theatre microfrontend for UgandaEMR", "browser": "dist/esm-theatre-app.js", diff --git a/packages/esm-ugandaemr-app/package.json b/packages/esm-ugandaemr-app/package.json index 83af1c61..27f880bc 100644 --- a/packages/esm-ugandaemr-app/package.json +++ b/packages/esm-ugandaemr-app/package.json @@ -1,6 +1,6 @@ { "name": "@ugandaemr/esm-ugandaemr-app", - "version": "1.0.1", + "version": "1.0.2", "license": "MPL-2.0", "description": "UgandaEMR microfrontend built on top of OpenMRS 3.x and OHRI", "browser": "dist/esm-ugandaemr-app.js",