updating gitignore and npmignore #59
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Node.js CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
release: | |
types: | |
- created | |
env: | |
ESM_NAME: "@ohri/openmrs-esm-rwanda" | |
JS_NAME: "openmrs-esm-rwanda.js" | |
jobs: | |
build: | |
name: Build and Test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "18.x" | |
- run: yarn install --immutable | |
- run: yarn verify | |
- run: yarn build | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist | |
path: dist | |
patch_release: | |
name: Patch Release | |
runs-on: ubuntu-latest | |
needs: build | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "18.x" | |
registry-url: "https://registry.npmjs.org" | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Version | |
run: | | |
NEW_VERSION=$(node -p "require('./package.json').version")-pre.${{ github.run_number }} | |
yarn version $NEW_VERSION | |
- name: Build | |
run: yarn turbo run build --color --concurrency=5 | |
- name: Publish | |
run: yarn config set npmAuthToken "${NODE_AUTH_TOKEN}" && yarn npm publish --access public --tag next | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
release: | |
name: Publish Release | |
runs-on: ubuntu-latest | |
needs: build | |
if: ${{ github.event_name == 'release' }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "18.x" | |
registry-url: "https://registry.npmjs.org" | |
- run: yarn install --immutable | |
- name: Publish Release Version | |
run: | | |
echo "Publishing release version..." | |
TAG_VERSION=${{ github.event.release.tag_name }} | |
if [ -z "$TAG_VERSION" ]; then | |
echo "Error: TAG_VERSION is empty." | |
exit 1 | |
fi | |
echo "Using release tag: $TAG_VERSION" | |
CURRENT_VERSION=$(node -p "require('./package.json').version") | |
if [ "$CURRENT_VERSION" != "$TAG_VERSION" ]; then | |
echo "Error: Version mismatch - package.json ($CURRENT_VERSION) vs. tag ($TAG_VERSION)." | |
exit 1 | |
fi | |
yarn config set npmAuthToken "${NODE_AUTH_TOKEN}" | |
yarn npm publish --access public --tag latest | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | |
deploy: | |
name: Deployment | |
runs-on: ubuntu-latest | |
needs: patch_release | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
steps: | |
- name: Trigger RefApp Build | |
run: echo "No deployment configured. Skipping." | |
# Uncomment and configure the following lines to trigger your 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 }}" }' |