Skip to content
This repository was archived by the owner on Nov 24, 2021. It is now read-only.

Commit cc5c480

Browse files
authored
Merge pull request #9 from covid-modeling/publish-release
Add a publish-release script for api
2 parents 64a7a45 + dd16ce3 commit cc5c480

File tree

2 files changed

+35
-4
lines changed

2 files changed

+35
-4
lines changed

packages/api/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ The api shared between the model-runner, the web front end, and the model connec
66

77
To publish the `@covid-modeling/api` package:
88

9-
1. [Authenticate to the GitHub Package Registry](https://help.github.com/en/packages/using-github-packages-with-your-projects-ecosystem/configuring-npm-for-use-with-github-packages)
10-
2. Bump api package version. Run `npm version <patch|minor|major>`
11-
3. Tag the repo `api-vX.Y.Z`
12-
4. run `npm publish`
9+
1. Update the version of the api package in its `package.json` file.
10+
1. Push this to origin, make sure it passes CI and makes its way to master.
11+
1. Run the `script/publish-release` with the name of the new release in
12+
the form `api/vA.B.C`. This creates the tag and pushes it to the `origin`
13+
remote.

packages/api/script/publish-release

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
VERSION=$1
6+
7+
if [ -z $VERSION ]; then
8+
cat <<MESSAGE
9+
Push a release tag of the api project to GitHub and kick off the
10+
release process
11+
12+
USAGE: publish-release <VERSION>
13+
14+
Where <VERSION> is the version to release. It must be in the form:
15+
16+
api/vA.B.C
17+
MESSAGE
18+
exit 1
19+
fi
20+
21+
if [[ $VERSION != api/v* ]]; then
22+
echo Invalid version specified. Expected the folowing format: api/vA.B.C
23+
echo
24+
exit 1
25+
fi
26+
27+
echo Publishing release of @codid-modeling/api package to npm
28+
29+
git tag -a -m $VERSION $VERSION
30+
git push origin $VERSION

0 commit comments

Comments
 (0)