Extracting version number from package.json in github action
From Logic Wiki
it's possible using jq which you can find more details with the link below
https://jqlang.github.io/jq/manual/#invoking-jq
usage :
- name: Extract version from package.json
run: |
VERSION=$(jq -r '.version' package.json)
echo "VERSION=$VERSION" >> $GITHUB_ENV
To create the tag :
- name: Create GitHub Release
id: create_release
uses: softprops/action-gh-release@v1
with:
files: |
SampleApi-v${{ env.VERSION }}.zip
tag_name: Live-v${{ env.VERSION }}