Skip to content

Commit

Permalink
chore: Added release please configuration for @buildwithsygma/utils (
Browse files Browse the repository at this point in the history
…#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
  • Loading branch information
saadahmsiddiqui authored Aug 16, 2024
1 parent ba1e3af commit 7654a26
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 4 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/release-utils.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Publish Sygma SDK Utilities package to GitHub Package Registry

on:
push:
branches: ["main"]
paths: ["packages/utils/**"]

jobs:
maybe-release:
name: release
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
# you should probably do this after your regular CI checks passes
# 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
- uses: google-github-actions/release-please-action@v3
id: release
with:
command: manifest
release-type: node
token: ${{secrets.RELEASE_TOKEN}}
config-file: "release-please/rp-utils-config.json"
manifest-file: "release-please/rp-utils-manifest.json"
monorepo-tags: true
default-branch: main
path: "packages/utils"
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}]'

- uses: actions/checkout@v4
# these if statements ensure that a publication only occurs when
# a new release is created:
if: ${{ steps.release.outputs.releases_created }}

- uses: actions/setup-node@v4
with:
cache: "yarn"
node-version: 18
registry-url: "https://registry.npmjs.org"
scope: "@buildwithsygma"
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
if: ${{ steps.release.outputs.releases_created }}

- name: Enable corepack
run: corepack enable
if: ${{ steps.release.outputs.releases_created }}

- name: Install dependencies
run: yarn install --immutable
if: ${{ steps.release.outputs.releases_created }}

- run: yarn build
if: ${{ steps.release.outputs.releases_created }}

- env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
if: ${{ steps.release.outputs.releases_created }}
run: |
echo -e "\nnpmAuthToken: \"$NODE_AUTH_TOKEN\"" >> ./.yarnrc.yml
- run: yarn workspace @buildwithsygma/utils npm publish --access public
if: ${{ steps.release.outputs.releases_created }}
8 changes: 5 additions & 3 deletions packages/utils/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## Introduction

This package provides utility functions for Sygma SDK.
This package provides utility functions for seamless integration of Sygma SDK.

[`@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.

## Installation

Expand All @@ -14,9 +16,9 @@ or
npm install @buildwithsygma/utils
```

### Usage
### Function: `hasEnoughLiquidity`

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

```typescript
import { hasEnoughLiquidity } from '@buildwithsygma/utils';
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@buildwithsygma/utils",
"version": "0.0.1",
"version": "1.0.0",
"description": "Utilities to support bridging and message passing",
"main": "dist-esm/index.js",
"types": "types/index.d.ts",
Expand Down
16 changes: 16 additions & 0 deletions release-please/rp-utils-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"plugins": ["node-workspace"],
"separate-pull-requests": true,
"packages": {
"packages/utils": {
"component": "utils",
"releaseType": "node",
"draft": false,
"prerelease": false,
"bumpMinorPreMajor": false,
"bumpPatchForMinorPreMajor": false,
"changelogPath": "CHANGELOG.md",
"versioning": "default"
}
}
}
1 change: 1 addition & 0 deletions release-please/rp-utils-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}

0 comments on commit 7654a26

Please sign in to comment.