Skip to content

Commit

Permalink
Publish the lib while merge to master if version get upgrated (alertl…
Browse files Browse the repository at this point in the history
…ogic#370)

* publish the lib while merge to master
  • Loading branch information
rakhimundhada15 authored Jun 24, 2024
1 parent aa7540a commit f5c7de8
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@alertlogic/paws-collector",
"version": "2.2.2",
"version": "2.2.3",
"license": "MIT",
"description": "Alert Logic AWS based API Poll Log Collector Library",
"repository": {
Expand Down
33 changes: 30 additions & 3 deletions ps_spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,34 @@ stages:
image: node:20
compute_size: small
commands:
- set -ex
- make test-all
- |
set -ex
echo //registry.npmjs.org/:_authToken=$NPM_TOKEN > .npmrc
npm whoami
PKGNAME=$(node -e 'console.log(require("./package.json").name)')
PKGVERSION=$(node -e 'console.log(require("./package.json").version)')
WORDCOUNT=$(npm view "${PKGNAME}@${PKGVERSION}" | wc -c)
git config --global credential.helper \'store\' || true
echo "https://$ALPS_GH_USER:[email protected]" > ~/.git-credentials
npm install
if [ $(git tag -l "$PKGVERSION") ]; then
echo "Skip tagging $PKGNAME $PKGVERSION version already exist"
else
git tag -a $PKGVERSION -m "$PKGNAME release $PKGVERSION" HEAD
if [ "$WORDCOUNT" -eq 0 ]; then
make test-all
echo "PUBLISHING $PKGNAME $PKGVERSION"
npm run lint
git push origin $PKGVERSION
npm publish --access public
else
echo "NOT PUBLISHING $PKGNAME $PKGVERSION"
fi
fi
- echo done
outputs:
file: ./.ps_outputs/*
Expand Down Expand Up @@ -313,7 +339,8 @@ stages:
image: 422372788747.dkr.ecr.us-east-1.amazonaws.com/al-paws-collector-pipeline:latest
compute_size: small_arm
when:
- tag: ['\d+.\d+.\d+']
- pull_request:
trigger_phrase: build-all-collectors
commands:
- source $NVM_DIR/nvm.sh && nvm use 20
- make package-all
Expand Down

0 comments on commit f5c7de8

Please sign in to comment.