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

[MOSIP-33991] Updated npm-publish-to-npm-registry.yml for release #150

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions .github/workflows/npm-publish-to-npm-registry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,18 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

- name: Tag
- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pwd
cd ${{ inputs.SERVICE_LOCATION }}
VERSION=$(grep -o '"version": "[^"]*' package.json | sed 's/"version": "//') #Replace with the versioning strategy you prefer
VERSION=$(grep -o '"version": "[^"]*' package.json | sed 's/"version": "//') # Replace with your versioning strategy
VERSION="v${VERSION}_npm"
git tag $VERSION
git push origin $VERSION
echo "Creating release $VERSION"
curl -X POST \
-H "Authorization: token $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/releases \
-d '{"tag_name": "'"$VERSION"'","name":"Release '"$VERSION"'","body":"Release '"$VERSION"'","draft":false,"prerelease":false}'

- uses: 8398a7/action-slack@v3
with:
Expand All @@ -91,4 +95,3 @@ jobs:
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required
if: "${{ github.event_name != 'pull_request' && failure() }}" # Pick up events even if the job fails or is canceled.