Skip to content
This repository was archived by the owner on Jul 10, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
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
9 changes: 4 additions & 5 deletions .github/workflows/publish_branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \' \")
Expand All @@ -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)"
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:

- name: Get version from npm and increment
run: |
set -x
yarn global add semver
PATH="$(yarn global bin):$PATH"

Expand All @@ -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 }}
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down