Difference between revisions of "Extracting version number from package.json in github action"

From Logic Wiki
Jump to: navigation, search
(Created page with "Category:Github Category:CICD it's possible using '''jq''' which you can find more details with the link below [https://jqlang.github.io/jq/manual/#invoking-jq http...")
 
(No difference)

Latest revision as of 09:09, 9 May 2024


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 }}