Skip to content

Commit

Permalink
(chore) Update CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
denniskigen authored Sep 30, 2023
1 parent fb14141 commit e135aa7
Showing 1 changed file with 50 additions and 13 deletions.
63 changes: 50 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,18 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'npm'
- run: yarn install --immutable
node-version: '18'

- name: Cache dependencies
id: cache
uses: actions/cache@v3
with:
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 a local cache server for Turborepo
uses: felixmosh/turborepo-gh-artifacts@v2
Expand All @@ -51,16 +60,33 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'npm'
- run: yarn install --immutable
- run: yarn version "$(node -e "console.log(require('semver').inc(require('./package.json').version, 'patch'))")-pre.${{ github.run_number }}"
- run: yarn turbo build:lib --color --concurrency=5
node-version: '18'

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

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

- name: Version
run: yarn version "$(node -e "console.log(require('semver').inc(require('./package.json').version, 'patch'))")-pre.${{ github.run_number }}"

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

- run: git config user.email "[email protected]" && git config user.name "OpenMRS CI"
- run: git add . && git commit -m "Prerelease version" --no-verify
- run: yarn config set npmAuthToken "${NODE_AUTH_TOKEN}" && yarn npm publish --access public --tag next

- name: Publish pre-release
run: yarn config set npmAlwaysAuth true && yarn config set npmAuthToken "${NODE_AUTH_TOKEN}" && yarn npm publish --access public --tag next
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
Expand All @@ -78,12 +104,23 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'npm'
- run: yarn install --immutable
node-version: '18'

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

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

- name: Build
run: yarn turbo build:lib --color --concurrency=5
- run: yarn config set npmAuthToken "${NODE_AUTH_TOKEN}" && yarn npm publish --access public --tag latest

- name: Publish release
run: yarn config set npmAuthToken "${NODE_AUTH_TOKEN}" && yarn npm publish --access public --tag latest
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

0 comments on commit e135aa7

Please sign in to comment.