Switch badge to @fluencelabs/fluence (#6)

This commit is contained in:
folex 2020-12-30 13:14:24 +03:00 committed by GitHub
parent 0c19f080df
commit 5ad4108361
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 9 deletions

View File

@ -31,15 +31,14 @@ jobs:
- name: Get version from npm and increment - name: Get version from npm and increment
run: | run: |
set -x # install semver and add it to PATH
yarn global add semver yarn global add semver
PATH="$(yarn global bin):$PATH" 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) # 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:]-' -)" 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 # take all versions from npm and replace single quotes with double quotes
NPM_VERSIONS=$(yarn info --silent "$PKG_NAME" versions 2>/dev/null | tr \' \") 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) # sort versions according to semver, take highest (last)
LAST_NPM_VERSION="$(semver -p $(echo $NPM_VERSIONS_FLATTENED) | tail -n1 || true)" LAST_NPM_VERSION="$(semver -p $(echo $NPM_VERSIONS_FLATTENED) | tail -n1 || true)"
# increment prerelease part of the version # 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 # take local version
LOCAL_VERSION="$(cat package.json | jq -r .version)" LOCAL_VERSION="$(cat package.json | jq -r .version)"

View File

@ -23,7 +23,6 @@ jobs:
- name: Get version from npm and increment - name: Get version from npm and increment
run: | run: |
set -x
yarn global add semver yarn global add semver
PATH="$(yarn global bin):$PATH" PATH="$(yarn global bin):$PATH"
@ -40,7 +39,7 @@ jobs:
# save info to env # save info to env
echo "FINAL_VERSION=$MAX_VERSION" | tee -a $GITHUB_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 ### Set version
- name: Set version to ${{ env.FINAL_VERSION }} - name: Set version to ${{ env.FINAL_VERSION }}
@ -59,7 +58,7 @@ jobs:
env: env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
### Create a pre-release ### Create a release
- name: Create Release - name: Create Release
id: create_release id: create_release
uses: actions/create-release@v1 uses: actions/create-release@v1

View File

@ -1,6 +1,6 @@
# Fluence browser client # 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. Browser client for the Fluence network based on the js-libp2p.