Skip to content

Commit

Permalink
Updates version file (#8)
Browse files Browse the repository at this point in the history
tweaks to release script
  • Loading branch information
pirupius authored Apr 3, 2023
1 parent e0ffe5b commit 8fb7f79
Show file tree
Hide file tree
Showing 4 changed files with 574 additions and 68 deletions.
84 changes: 18 additions & 66 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,50 +44,21 @@ 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: '16'
registry-url: "https://registry.npmjs.org"

- 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 local cache server for Turborepo
uses: felixmosh/turborepo-gh-artifacts@v2
with:
repo-token: ${{ secrets.GITHUB_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 }}" --no-git-tag-version --no-push --yes

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

- run: git config user.email "info@openmrs.org" && git config user.name "OpenMRS CI"
- run: git add . && git commit -m "Prerelease version" --no-verify

- name: Pre-release
run: yarn run ci:prepublish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: packages
path: |
packages/**/dist
- run: yarn install
- run: sed -i -e "s/\(\"version\":\\s\+\"\([0-9]\+\.\?\)\+\)/\1-pre.${{ github.run_number }}/" 'package.json'
- run: |
yarn config set npmAlwaysAuth true
yarn config set npmAuthToken ${{ secrets.NPM_AUTH_TOKEN }}
- run: yarn npm publish --tag next

release:
runs-on: ubuntu-latest
Expand All @@ -98,33 +69,14 @@ 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'
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
uses: felixmosh/turborepo-gh-artifacts@v2
uses: actions/setup-node@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
server-token: ${{ env.TURBO_TOKEN }}

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

- name: Publish
run: yarn run ci:publish
node-version: "16.x"
registry-url: 'https://registry.npmjs.org'
- run: yarn
- run: yarn config set npmAuthToken "${NODE_AUTH_TOKEN}" && yarn npm publish --access public --tag latest
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
550 changes: 550 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-version.cjs

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
nodeLinker: node-modules

yarnPath: ".yarn/releases/yarn-berry.cjs"
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-version.cjs
spec: "@yarnpkg/plugin-version"

yarnPath: .yarn/releases/yarn-berry.cjs
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openmrs/openmrs-form-engine-lib",
"version": "1.0.1",
"version": "1.0.0",
"description": "A React based Forms Engine for OpenMRS 3.X",
"browser": "dist/openmrs-form-engine-lib.js",
"main": "src/index.ts",
Expand Down

0 comments on commit 8fb7f79

Please sign in to comment.