Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 7654a26

Browse files
chore: Added release please configuration for @buildwithsygma/utils (#459)
chore: Added release please configuration for `@buildwithsygma/utils` package Added release please configuration json file and manifest json file. Updated package json of `@buildwithsygma/utils` with the version that sygma team has agreed to start from. `README.md` file within `@buildwithsygma/utils` has also been updated with explanation and documentation
1 parent ba1e3af commit 7654a26

File tree

5 files changed

+85
-4
lines changed

5 files changed

+85
-4
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Publish Sygma SDK Utilities package to GitHub Package Registry
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
paths: ["packages/utils/**"]
7+
8+
jobs:
9+
maybe-release:
10+
name: release
11+
runs-on: ubuntu-latest
12+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
13+
steps:
14+
# you should probably do this after your regular CI checks passes
15+
# it will analyze commits and create PR with new version and updated CHANGELOG:md file. On merging it will create github release page with changelog
16+
- uses: google-github-actions/release-please-action@v3
17+
id: release
18+
with:
19+
command: manifest
20+
release-type: node
21+
token: ${{secrets.RELEASE_TOKEN}}
22+
config-file: "release-please/rp-utils-config.json"
23+
manifest-file: "release-please/rp-utils-manifest.json"
24+
monorepo-tags: true
25+
default-branch: main
26+
path: "packages/utils"
27+
changelog-types: '[{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"chore","section":"Miscellaneous","hidden":false},{"type":"revert","hidden":true}]'
28+
29+
- uses: actions/checkout@v4
30+
# these if statements ensure that a publication only occurs when
31+
# a new release is created:
32+
if: ${{ steps.release.outputs.releases_created }}
33+
34+
- uses: actions/setup-node@v4
35+
with:
36+
cache: "yarn"
37+
node-version: 18
38+
registry-url: "https://registry.npmjs.org"
39+
scope: "@buildwithsygma"
40+
env:
41+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
42+
if: ${{ steps.release.outputs.releases_created }}
43+
44+
- name: Enable corepack
45+
run: corepack enable
46+
if: ${{ steps.release.outputs.releases_created }}
47+
48+
- name: Install dependencies
49+
run: yarn install --immutable
50+
if: ${{ steps.release.outputs.releases_created }}
51+
52+
- run: yarn build
53+
if: ${{ steps.release.outputs.releases_created }}
54+
55+
- env:
56+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
57+
if: ${{ steps.release.outputs.releases_created }}
58+
run: |
59+
echo -e "\nnpmAuthToken: \"$NODE_AUTH_TOKEN\"" >> ./.yarnrc.yml
60+
61+
- run: yarn workspace @buildwithsygma/utils npm publish --access public
62+
if: ${{ steps.release.outputs.releases_created }}

packages/utils/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
## Introduction
22

3-
This package provides utility functions for Sygma SDK.
3+
This package provides utility functions for seamless integration of Sygma SDK.
4+
5+
[`@buildwithsygma/evm`](../evm/README.md) and [`@buildwithsygma/substrate`](../substrate/README.md) packages can be used to transfer tokens from one network to another. However, there is a possibilty that the transfer might fail due to insufficient liquidity on Sygma protocol handlers. Therefore, this package provides utility function that can be used to avoid such failures.
46

57
## Installation
68

@@ -14,9 +16,9 @@ or
1416
npm install @buildwithsygma/utils
1517
```
1618

17-
### Usage
19+
### Function: `hasEnoughLiquidity`
1820

19-
Currently you can use the `hasEnoughLiquidity` function to check if there is enough liquidity on the destination handler for the transfer to be completed.
21+
#### Example
2022

2123
```typescript
2224
import { hasEnoughLiquidity } from '@buildwithsygma/utils';

packages/utils/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@buildwithsygma/utils",
3-
"version": "0.0.1",
3+
"version": "1.0.0",
44
"description": "Utilities to support bridging and message passing",
55
"main": "dist-esm/index.js",
66
"types": "types/index.d.ts",
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"plugins": ["node-workspace"],
3+
"separate-pull-requests": true,
4+
"packages": {
5+
"packages/utils": {
6+
"component": "utils",
7+
"releaseType": "node",
8+
"draft": false,
9+
"prerelease": false,
10+
"bumpMinorPreMajor": false,
11+
"bumpPatchForMinorPreMajor": false,
12+
"changelogPath": "CHANGELOG.md",
13+
"versioning": "default"
14+
}
15+
}
16+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

0 commit comments

Comments
 (0)