Skip to content

Commit

Permalink
Merge pull request #72 from ThalaLabs/publish-to-github-actions
Browse files Browse the repository at this point in the history
publish to github actions
  • Loading branch information
SamuelQZQ authored May 30, 2024
2 parents 04f1ab5 + c6afd89 commit 8a8f868
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .changeset/four-papayas-pull.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@thalalabs/thalaswap-math": major
"@thalalabs/thalaswap-math": patch
---

Update Readme & move some files
12 changes: 10 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,16 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'

cache: "pnpm"

- name: Creating .npmrc
run: |
cat << EOF > "$HOME/.npmrc"
//npm.pkg.github.com/:_authToken=$NPM_TOKEN
EOF
env:
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- run: pnpm i
- name: Create Release Pull Request or Publish
id: changesets
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,4 @@ dist

.DS_Store
.turbo
.npmrc
16 changes: 16 additions & 0 deletions packages/thalaswap-math/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ SDK to calculate swap amounts and pool price.

# install

Edit or add a `.npmrc` file to including following lines:
```
//npm.pkg.github.com/:_authToken=_authToken
@thalalabs:registry=https://npm.pkg.github.com
```

Run command to login:
```
$ npm login --registry=https://npm.pkg.github.com
> Username: USERNAME
> Password: TOKEN
```

USERNAME is you github account username. Get the token from your github settings, see ["Managing your personal access tokens."](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens).


```
$ npm i @thalalabs/thalaswap-math
```
Expand Down
10 changes: 6 additions & 4 deletions packages/thalaswap-math/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,21 @@
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"publishConfig": {
"access": "public"
},
"keywords": [
"move",
"blockchain",
"aptos"
],
"author": "",
"license": "MIT",
"publishConfig": {
"access": "public",
"registry": "https://npm.pkg.github.com"
},
"repository": {
"type": "git",
"url": "git+https://github.com/ThalaLabs/thala-sdk.git"
"url": "git+https://github.com/ThalaLabs/thala-sdk.git",
"directory": "packages/thalaswap-math"
},
"devDependencies": {
"@types/jest": "^29.5.12",
Expand Down
23 changes: 23 additions & 0 deletions packages/thalaswap-router/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,29 @@

SDK to get optimal swap routing for ThalaSwap. Currently, we support finding routes of no more than 3 hops.

## Install

Edit or add a `.npmrc` file to including following lines:

```
//npm.pkg.github.com/:_authToken=_authToken
@thalalabs:registry=https://npm.pkg.github.com
```

Run command to login:

```
$ npm login --registry=https://npm.pkg.github.com
> Username: USERNAME
> Password: TOKEN
```

USERNAME is you github account username. Get the token from your github settings, see ["Managing your personal access tokens."](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens).

```
$ npm i @thalalabs/router-sdk
```

## Examples

```
Expand Down
10 changes: 6 additions & 4 deletions packages/thalaswap-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@
"files": [
"dist"
],
"publishConfig": {
"access": "public",
"registry": "https://npm.pkg.github.com"
},
"repository": {
"type": "git",
"url": "git+https://github.com/ThalaLabs/thala-sdk.git"
},
"publishConfig": {
"access": "public"
"url": "git+https://github.com/ThalaLabs/thala-sdk.git",
"directory": "packages/thalaswap-router"
},
"devDependencies": {
"@aptos-labs/ts-sdk": "^1.11.0",
Expand Down

0 comments on commit 8a8f868

Please sign in to comment.