Skip to content

Commit

Permalink
Merge branch 'main' into refactor/add-contract-build-function
Browse files Browse the repository at this point in the history
  • Loading branch information
blockchainguyy authored Jul 15, 2024
2 parents ac09ac6 + b67be1b commit 7dc6c13
Show file tree
Hide file tree
Showing 15 changed files with 1,282 additions and 155 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
66 changes: 66 additions & 0 deletions .github/actions/install/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Install Dependencies
description: 'Setup Sui CLI and install dependencies'

inputs:
SUI_VERSION:
description: 'The version of Sui CLI to install'
required: true

runs:
using: 'composite'

steps:
- name: Debug Action Input
shell: bash
run: echo "SUI_VERSION=${{ inputs.SUI_VERSION }}"

- name: Install Dependencies
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y libpq-dev
- name: Cache Sui binaries
id: cache-sui
uses: actions/cache@v4
with:
path: sui-binaries/
key: sui-${{ inputs.SUI_VERSION }}

- name: Download and Install Sui
shell: bash
if: steps.cache-sui.outputs.cache-hit != 'true'
run: |
curl -L -o sui-${{ inputs.SUI_VERSION }}-ubuntu-x86_64.tgz https://github.com/MystenLabs/sui/releases/download/${{ inputs.SUI_VERSION }}/sui-${{ inputs.SUI_VERSION }}-ubuntu-x86_64.tgz
tar -xvf sui-${{ inputs.SUI_VERSION }}-ubuntu-x86_64.tgz
mkdir -p sui-binaries
mv ./sui ./sui-binaries/
mv ./sui-debug ./sui-binaries/
mv ./sui-test-validator ./sui-binaries/
rm -rf sui-${{ inputs.SUI_VERSION }}-ubuntu-x86_64.tgz
- name: Save Sui binaries
if: steps.cache-sui.outputs.cache-hit != 'true'
id: cache-sui-save
uses: actions/cache@v4
with:
path: sui-binaries/
key: sui-${{ inputs.SUI_VERSION }}

- name: Add Sui binaries to PATH
shell: bash
run: |
sudo cp ./sui-binaries/sui /usr/local/bin/sui
sudo cp ./sui-binaries/sui-debug /usr/local/bin/sui-debug
sudo cp ./sui-binaries/sui-test-validator /usr/local/bin/sui-test-validator
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
shell: bash
run: npm ci
45 changes: 3 additions & 42 deletions .github/workflows/codecov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,52 +14,13 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y libpq-dev
- name: Cache Sui binaries
id: cache-sui
uses: actions/cache/restore@v4
with:
path: sui-binaries/
key: sui-${{ env.SUI_VERSION }}

- name: Download and Install Sui
if: steps.cache-sui.outputs.cache-hit != 'true'
run: |
curl -L -o sui-${SUI_VERSION}-ubuntu-x86_64.tgz https://github.com/MystenLabs/sui/releases/download/${SUI_VERSION}/sui-${SUI_VERSION}-ubuntu-x86_64.tgz
tar -xvf sui-${SUI_VERSION}-ubuntu-x86_64.tgz
mkdir -p sui-binaries
mv ./sui sui-binaries/
mv ./sui-debug sui-binaries/
rm -rf sui-${SUI_VERSION}-ubuntu-x86_64.tgz
- name: Save Sui binaries
if: steps.cache-sui.outputs.cache-hit != 'true'
id: cache-sui-save
uses: actions/cache/save@v4
with:
path: sui-binaries/
key: ${{ steps.cache-sui.outputs.cache-primary-key }}

- name: Add Sui binaries to PATH
run: |
sudo cp ./sui-binaries/sui /usr/local/bin/sui
sudo cp ./sui-binaries/sui-debug /usr/local/bin/sui-debug
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
- name: Setup Sui CLI and install dependencies
uses: ./.github/actions/install
with:
node-version: 18
cache: 'npm'

- name: Install dependencies
run: npm ci
SUI_VERSION: ${{ env.SUI_VERSION }}

- name: Coverage
run: npm run coverage
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/publish-to-npm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 'Publish to NPM'

on:
workflow_dispatch:
release:
types: [published]

env:
SUI_VERSION: mainnet-v1.25.3

jobs:
publish-to-npm:
name: 'Publish to NPM'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Sui CLI and install dependencies
uses: ./.github/actions/install
with:
SUI_VERSION: ${{ env.SUI_VERSION }}

- name: Build TS and Move Modules
run: npm run build

- name: Publish
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
45 changes: 45 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Release

on:
push:
branches:
- main
workflow_dispatch:

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'

- name: Install dependencies
shell: bash
run: npm ci

- name: Check for changeset files
id: checkfile
run: |
if ls .changeset/*.md | grep '\.changeset\/[a-z-]\+\.md$'; then
echo "has_file=true" >> "$GITHUB_OUTPUT"
else
echo "has_file=false" >> "$GITHUB_OUTPUT"
fi
- name: Create Release Pull Request
if: steps.checkfile.outputs.has_file == 'true'
uses: changesets/action@v1
with:
title: 'chore: update versions'
commit: 'chore: update versions'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52 changes: 5 additions & 47 deletions .github/workflows/test-js.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,60 +17,18 @@ env:
jobs:
test-js:
runs-on: ubuntu-latest

steps:
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y libpq-dev
- name: Cache Sui binaries
id: cache-sui
uses: actions/cache/restore@v4
with:
path: sui-binaries-skip/
key: sui-${{ env.SUI_VERSION }}

- name: Download and Install Sui
if: steps.cache-sui.outputs.cache-hit != 'true'
run: |
curl -L -o sui-${SUI_VERSION}-ubuntu-x86_64.tgz https://github.com/MystenLabs/sui/releases/download/${SUI_VERSION}/sui-${SUI_VERSION}-ubuntu-x86_64.tgz
tar -xvf sui-${SUI_VERSION}-ubuntu-x86_64.tgz
mkdir -p sui-binaries
mv ./sui ./sui-binaries/
mv ./sui-debug ./sui-binaries/
mv ./sui-test-validator ./sui-binaries/
rm -rf sui-${SUI_VERSION}-ubuntu-x86_64.tgz
- name: Save Sui binaries
if: steps.cache-sui.outputs.cache-hit != 'true'
id: cache-sui-save
uses: actions/cache/save@v4
with:
path: sui-binaries/
key: ${{ steps.cache-sui.outputs.cache-primary-key }}

- name: Add Sui binaries to PATH
run: |
sudo cp ./sui-binaries/sui /usr/local/bin/sui
sudo cp ./sui-binaries/sui-debug /usr/local/bin/sui-debug
sudo cp ./sui-binaries/sui-test-validator /usr/local/bin/sui-test-validator
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
- name: Setup Sui CLI and install dependencies
uses: ./.github/actions/install
with:
node-version: 18
cache: 'npm'
SUI_VERSION: ${{ env.SUI_VERSION }}

- name: Install dependencies
run: npm ci

- name: Build
- name: Build TS and Move Modules
run: npm run build

- name: Run Localnet
run: nohup sh -c "sui-test-validator" > nohup.out 2> nohup.err < /dev/null &

Expand Down
50 changes: 5 additions & 45 deletions .github/workflows/test-move.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,57 +17,17 @@ env:
jobs:
test-move:
runs-on: ubuntu-latest

steps:
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y libpq-dev
- name: Cache Sui binaries
id: cache-sui
uses: actions/cache/restore@v4
with:
path: sui-binaries/
key: sui-${{ env.SUI_VERSION }}

- name: Download and Install Sui
if: steps.cache-sui.outputs.cache-hit != 'true'
run: |
curl -L -o sui-${SUI_VERSION}-ubuntu-x86_64.tgz https://github.com/MystenLabs/sui/releases/download/${SUI_VERSION}/sui-${SUI_VERSION}-ubuntu-x86_64.tgz
tar -xvf sui-${SUI_VERSION}-ubuntu-x86_64.tgz
mkdir -p sui-binaries
mv ./sui ./sui-binaries/
mv ./sui-debug ./sui-binaries/
rm -rf sui-${SUI_VERSION}-ubuntu-x86_64.tgz
- name: Save Sui binaries
if: steps.cache-sui.outputs.cache-hit != 'true'
id: cache-sui-save
uses: actions/cache/save@v4
with:
path: sui-binaries/
key: ${{ steps.cache-sui.outputs.cache-primary-key }}

- name: Add Sui binaries to PATH
run: |
sudo cp ./sui-binaries/sui /usr/local/bin/sui
sudo cp ./sui-binaries/sui-debug /usr/local/bin/sui-debug
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
- name: Setup Sui CLI and install dependencies
uses: ./.github/actions/install
with:
node-version: 18
cache: 'npm'

- name: Install dependencies
run: npm ci
SUI_VERSION: ${{ env.SUI_VERSION }}

- name: Build
run: npm run build
- name: Build Move Modules
run: npm run build-move

- name: Test
run: npm run test-move
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ web_modules/
# Optional eslint cache
.eslintcache

# Generated Build Output
dist

# dotenv environment variable files
.env
.env.development.local
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ Sui framework dependency is pinned to a specific mainnet [release](https://githu

Official Sui deployment and operations scripts can be found [here](https://github.com/axelarnetwork/axelar-contract-deployments/tree/main/sui#sui-deployment-scripts).

## Release Process

Please check the [release process](./docs/release.md) for more details.

## Gateway

The gateway lives in a few modules but has all of its storage in a single shared object called `AxelarSigners`.
Expand Down
Loading

0 comments on commit 7dc6c13

Please sign in to comment.