diff --git a/.github/workflows/publish_branch.yml b/.github/workflows/publish_branch.yml index b94a77b8..1c2b9278 100644 --- a/.github/workflows/publish_branch.yml +++ b/.github/workflows/publish_branch.yml @@ -31,15 +31,14 @@ jobs: - name: Get version from npm and increment run: | - set -x + # install semver and add it to PATH yarn global add semver PATH="$(yarn global bin):$PATH" - # take npm version and increment it - PKG_NAME="$(cat package.json | jq -r .name)" - # sanitize branch name so it can be used as a semver suffix (replace [^0-9a-zA-Z-] with hyphen) SANITIZED_BRANCH="$(echo -n "${{ env.BRANCH_NAME }}" | tr -C '[:alnum:]-' -)" + # get package name from package.json + PKG_NAME="$(cat package.json | jq -r .name)" # take all versions from npm and replace single quotes with double quotes NPM_VERSIONS=$(yarn info --silent "$PKG_NAME" versions 2>/dev/null | tr \' \") @@ -50,7 +49,7 @@ jobs: # sort versions according to semver, take highest (last) LAST_NPM_VERSION="$(semver -p $(echo $NPM_VERSIONS_FLATTENED) | tail -n1 || true)" # increment prerelease part of the version - PRERELEASE_NPM_VERSION="$(semver --increment prerelease --preid "$SANITIZED_BRANCH" "${LAST_NPM_VERSION}" || true)" # added '-0' here to avoid semver erroneously increment patch octet. Any suffix works, '-0' is chosen deliberately. + PRERELEASE_NPM_VERSION="$(semver --increment prerelease --preid "$SANITIZED_BRANCH" "${LAST_NPM_VERSION}" || true)" # take local version LOCAL_VERSION="$(cat package.json | jq -r .version)" diff --git a/.github/workflows/publish_release.yml b/.github/workflows/publish_release.yml index 58add21d..f36d9b6e 100644 --- a/.github/workflows/publish_release.yml +++ b/.github/workflows/publish_release.yml @@ -23,7 +23,6 @@ jobs: - name: Get version from npm and increment run: | - set -x yarn global add semver PATH="$(yarn global bin):$PATH" @@ -40,7 +39,7 @@ jobs: # save info to env echo "FINAL_VERSION=$MAX_VERSION" | tee -a $GITHUB_ENV - echo "PKG_NAME=$PKG_NAME" | tee -a $GITHUB_ENV" + echo "PKG_NAME=$PKG_NAME" | tee -a $GITHUB_ENV ### Set version - name: Set version to ${{ env.FINAL_VERSION }} @@ -59,7 +58,7 @@ jobs: env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - ### Create a pre-release + ### Create a release - name: Create Release id: create_release uses: actions/create-release@v1 diff --git a/README.md b/README.md index 24dae5d6..dd0f3d0a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Fluence browser client -[![npm version](https://badge.fury.io/js/fluence.svg)](https://badge.fury.io/js/fluence) +[![npm version](https://badge.fury.io/js/%40fluencelabs%2Ffluence.svg)](https://badge.fury.io/js/%40fluencelabs%2Ffluence) Browser client for the Fluence network based on the js-libp2p.