Add npm package

This commit is contained in:
Pavel Murygin 2021-05-27 13:55:14 +03:00
parent 46ecb80eb8
commit 7320937f7e
7 changed files with 128 additions and 0 deletions

71
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,71 @@
name: "publish-release"
on:
push:
branches:
- "main"
jobs:
npm-publish:
name: "Publish"
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./npm
shell: bash
steps:
- name: Checkout repository
uses: actions/checkout@v2
### Calculate FINAL_VERSION
- name: Install jq
run: sudo apt-get update && sudo apt-get --yes --force-yes install jq
- name: Get version from npm and increment
run: |
yarn global add semver
PATH="$(yarn global bin):$PATH"
# take npm version and increment it
PKG_NAME="$(cat package.json | jq -r .name)"
NPM_VERSION="$(yarn info --silent "$PKG_NAME" version || true)"
NEXT_NPM_VERSION="$(semver --increment patch "$NPM_VERSION")"
# take local version
LOCAL_VERSION="$(cat package.json | jq -r .version)"
# take maximum of the local and NEXT_NPM versions
MAX_VERSION="$(semver "$LOCAL_VERSION" "$NEXT_NPM_VERSION" "0.0.0" | tail -n1)"
# save info to env
echo "FINAL_VERSION=$MAX_VERSION" | tee -a $GITHUB_ENV
echo "PKG_NAME=$PKG_NAME" | tee -a $GITHUB_ENV
### Set version
- name: Set version to ${{ env.FINAL_VERSION }}
run: yarn version --new-version ${{ env.FINAL_VERSION }} --no-git-tag-version
### Publish to NPM registry
- uses: actions/setup-node@v1
with:
node-version: "14"
registry-url: "https://registry.npmjs.org"
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
### Create a release
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.FINAL_VERSION }}
release_name: Aqua DHT ${{ env.FINAL_VERSION }}
body: |
[${{ env.FINAL_VERSION }} @ NPM registry](https://www.npmjs.com/package/${{ env.PKG_NAME }}/v/${{ env.FINAL_VERSION }})
draft: false
prerelease: false

1
npm/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.tgz

7
npm/LICENSE Normal file
View File

@ -0,0 +1,7 @@
Copyright 2021 Fluence Labs
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0
npm/dht.aqua Normal file
View File

5
npm/package-lock.json generated Normal file
View File

@ -0,0 +1,5 @@
{
"name": "@fluencelabs/aqua-dht",
"version": "0.1.0",
"lockfileVersion": 1
}

23
npm/package.json Normal file
View File

@ -0,0 +1,23 @@
{
"name": "@fluencelabs/aqua-dht",
"version": "0.1.0",
"description": "Aqua DHT library",
"files": [
"dht.aqua"
],
"scripts": {},
"repository": {
"type": "git",
"url": "git+https://github.com/fluencelabs/aqua-dht.git"
},
"keywords": [
"aqua",
"fluence"
],
"author": "Fluence Labs",
"license": "MIT",
"bugs": {
"url": "https://github.com/fluencelabs/aqua-dht/issues"
},
"homepage": "https://github.com/fluencelabs/aqua-dht#readme"
}

21
npm/readme.md Normal file
View File

@ -0,0 +1,21 @@
## Aqua
Aqua is a new-gen language for distributed systems.
Aqua programs are executed on many peers, sequentially
or in parallel, forming a single-use coordination network.
Aqua's runtime is heterogeneous: it includes browsers, servers, devices, all involved in solving a single task.
Therefore, Aqua scripts are compiled into several targets at once, with AIR and Typescript as a default.
## aqua-lib
TBD
### usage
TBD
### references
- To get started writing aqua see: https://github.com/fluencelabs/aqua-playground