Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(#9362): publish cht-deploy to npm on version change #9363

Closed
wants to merge 13 commits into from
34 changes: 34 additions & 0 deletions .github/workflows/npm-publish-cht-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish cht-deploy to npm

on:
push:
branches:
- master

jobs:
publish:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./scripts/deploy

steps:
- uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: '20.x'

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm test
garethbowen marked this conversation as resolved.
Show resolved Hide resolved

- name: Publish to npm
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
access: public
package: ./scripts/deploy/package.json
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In cht-conf we use semantic release to do this and it would be great to use the same in both places, but that library is designed to also update the version and generate release notes so maybe it's overkill. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, semantic release is cool and more comprehensive. I liked the automated changelog.md. I was assuming that it would try to include all the CHT related commits in the release notes. That may not be the case.. If that's not the case, there is a commits analyzer to filter out commits that don't have anything to do with cht-deploy. I'll give it a look.

2 changes: 1 addition & 1 deletion scripts/deploy/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@medic/cht-deploy",
"version": "1.0.10",
"version": "2.0.0",
"description": "## Deploy the CHT",
"main": "src/install.js",
"directories": {
Expand Down