File tree Expand file tree Collapse file tree 4 files changed +47
-6
lines changed Expand file tree Collapse file tree 4 files changed +47
-6
lines changed Original file line number Diff line number Diff line change 1+ name : Release NodeJS Package
2+
3+ on :
4+ push :
5+ branches : [ master, develop ]
6+ paths :
7+ - ' source/ports/node_port/package.json'
8+
9+ concurrency :
10+ group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
11+ cancel-in-progress : true
12+
13+ jobs :
14+ release :
15+ name : Release NodeJS Port
16+ runs-on : ubuntu-latest
17+ steps :
18+ - name : Check out the repo
19+ uses : actions/checkout@v4
20+ with :
21+ fetch-depth : 0
22+ - name : Release the port
23+ working-directory : source/ports/node_port
24+ env :
25+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
26+ run : ./upload.sh
Original file line number Diff line number Diff line change 1919# limitations under the License.
2020#
2121
22- # TODO: Update version in package.json
23- # TODO: Automate for CD/CI
22+ set -euxo pipefail
23+
24+ NPM_VERSION=$( npm view metacall version)
25+ PORT_VERSION=$( node -p " require('./package.json').version" )
26+
27+ if [[ " $NPM_VERSION " == " $PORT_VERSION " ]]; then
28+ echo " Current package version is the same as NPM version, skipping upload."
29+ exit 0
30+ fi
31+
32+ if [[ -z " ${NPM_TOKEN:- } " ]]; then
33+ echo " NPM_TOKEN environment variable is not set or empty, skipping upload"
34+ exit 1
35+ fi
36+
37+ # Register the token
38+ echo " //registry.npmjs.org/:_authToken=${NPM_TOKEN} " > ~ /.npmrc
2439
2540# Publish
26- npm login && npm publish
41+ npm login
42+ npm publish
Original file line number Diff line number Diff line change 1- 0.5.1
1+ 0.5.2
Original file line number Diff line number Diff line change @@ -30,8 +30,7 @@ if [[ "$PYPI_VERSION" == "$PORT_VERSION" ]]; then
3030fi
3131
3232# Install dependencies and upload MetaCall package
33- python3 -m pip install --user --upgrade twine setuptools wheel # build
34- # python3 -m build
33+ python3 -m pip install --user --upgrade twine setuptools wheel
3534python3 setup.py sdist bdist_wheel
3635python3 -m twine check dist/*
3736python3 -m twine upload dist/*
You can’t perform that action at this time.
0 commit comments