Skip to content

Commit

Permalink
Merge pull request #12 from nabla-studio/next
Browse files Browse the repository at this point in the history
Release 1.0.0
  • Loading branch information
DavideSegullo committed Jun 6, 2023
2 parents 1a0a175 + 1d9010c commit 185531a
Show file tree
Hide file tree
Showing 26 changed files with 5,821 additions and 4,616 deletions.
Empty file added .github/.gitkeep
Empty file.
132 changes: 132 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
name: 'Build and Deploy'

permissions:
actions: write
deployments: write
packages: write
pull-requests: write
issues: write

on:
push:
branches:
- main
- next

jobs:
release:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ github.workspace }}
strategy:
matrix:
node-version: [16]
npm-version: [8]
yarn-version: ['1.22.x']
pnpm-version: [7.27.0]
steps:
- name: Checkout [Pull Request]
uses: actions/checkout@v2
if: ${{ github.event_name == 'pull_request' }}
with:
ref: ${{ github.event.pull_request.head.sha }}
token: ${{ secrets.GH_TOKEN }}
fetch-depth: 0

- name: Checkout [Default Branch]
uses: actions/checkout@v2
if: ${{ github.event_name != 'pull_request' }}
with:
token: ${{ secrets.GH_TOKEN }}
fetch-depth: 0

- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v2
with:
main-branch-name: ${{ github.base_ref }}

- name: Detect package manager
id: package_manager
run: |
echo "::set-output name=name::$([[ -f ./yarn.lock ]] && echo "yarn" || ([[ -f ./pnpm-lock.yaml ]] && echo "pnpm") || echo "npm")"
- name: Set node/npm/yarn versions using volta
uses: volta-cli/[email protected]
with:
node-version: '${{ matrix.node-version }}'
npm-version: '${{ matrix.npm-version }}'
yarn-version: '${{ matrix.yarn-version }}'

- name: Install PNPM
if: steps.package_manager.outputs.name == 'pnpm'
uses: pnpm/[email protected]
with:
version: '${{ matrix.pnpm-version }}'

- name: Print node/npm/yarn/pnpm versions
id: versions
run: |
node_ver=$( node --version )
yarn_ver=$( yarn --version || true )
pnpm_ver=$( pnpm --version || true )
echo "Node: ${node_ver:1}"
echo "NPM: $(npm --version )"
if [[ $yarn_ver != '' ]]; then echo "Yarn: $yarn_ver"; fi
if [[ $pnpm_ver != '' ]]; then echo "PNPM: $pnpm_ver"; fi
echo "::set-output name=node_version::${node_ver:1}"
- name: Use the node_modules cache if available [npm]
if: steps.package_manager.outputs.name == 'npm'
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ steps.versions.outputs.node_version }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ steps.versions.outputs.node_version }}-
- name: Use the node_modules cache if available [pnpm]
if: steps.package_manager.outputs.name == 'pnpm'
uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-node-${{ steps.versions.outputs.node_version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-node-${{ steps.versions.outputs.node_version }}-
- name: Get yarn cache directory path
if: steps.package_manager.outputs.name == 'yarn'
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Use the node_modules cache if available [yarn]
if: steps.package_manager.outputs.name == 'yarn'
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-node-${{ steps.versions.outputs.node_version }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-${{ steps.versions.outputs.node_version }}-
- name: Install dependencies
run: |
if [ "${{ steps.package_manager.outputs.name == 'yarn' }}" == "true" ]; then
echo "Running yarn install --frozen-lockfile"
yarn install --frozen-lockfile
elif [ "${{ steps.package_manager.outputs.name == 'pnpm' }}" == "true" ]; then
echo "Running pnpm install --frozen-lockfile"
pnpm install --frozen-lockfile
else
echo "Running npm ci"
npm ci
fi
- name: Release
if: ${{ success() && (github.event_name != 'pull_request' || github.event.action == 'closed' && github.event.pull_request.merged == true) }}
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
npx nx run txs-tracer-core:semantic-release
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --edit $1
#npx --no-install commitlint --edit $1
57 changes: 48 additions & 9 deletions apps/demo-app-cosmos/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
import { Chain } from "@chain-registry/types";
import { ChakraProvider } from "@chakra-ui/react";
import { Decimal } from "@cosmjs/math";
import { GasPrice } from "@cosmjs/stargate";
import { Registry } from "@cosmjs/proto-signing";
import { AminoTypes, GasPrice } from "@cosmjs/stargate";
import { wallets as keplrWallets } from "@cosmos-kit/keplr";
import { ChainProvider, defaultTheme } from "@cosmos-kit/react";
import { assets, chains } from "chain-registry";
import type { AppProps } from "next/app";
import {
cosmosAminoConverters,
cosmosProtoRegistry,
cosmwasmAminoConverters,
cosmwasmProtoRegistry,
ibcAminoConverters,
ibcProtoRegistry,
osmosisAminoConverters,
osmosisProtoRegistry,
} from 'osmojs';

function MyApp({ Component, pageProps }: AppProps) {
return (
Expand All @@ -21,17 +32,45 @@ function MyApp({ Component, pageProps }: AppProps) {
wallets={[
...keplrWallets,
]}
defaultNameService={"osmosis"}
walletConnectOptions={{
signClient: {
projectId: process.env.NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID ?? '',
relayUrl: process.env.NEXT_PUBLIC_WALLET_CONNECT_RELAY_URL,
metadata: {
name: process.env.NEXT_PUBLIC_WALLET_CONNECT_METADATA_NAME ?? '',
description:
process.env.NEXT_PUBLIC_WALLET_CONNECT_METADATA_DESCRIPTION ?? '',
url: process.env.NEXT_PUBLIC_WALLET_CONNECT_METADATA_URL ?? '',
icons: [process.env.NEXT_PUBLIC_WALLET_CONNECT_METADATA_ICON ?? ''],
},
},
}}
signerOptions={{
signingStargate: (chain: Chain) => {
switch (chain.chain_name) {
case "osmosis":
return {
gasPrice: new GasPrice(Decimal.zero(1), "uosmo"),
};
default:
return void 0;
let gasPrice: GasPrice | undefined = undefined;

if (chain.fees && chain.fees.fee_tokens.length > 0) {
gasPrice = new GasPrice(
Decimal.zero(1),
chain.fees.fee_tokens[0].denom,
);
}

return {
gasPrice,
registry: new Registry([
...ibcProtoRegistry,
...cosmosProtoRegistry,
...osmosisProtoRegistry,
...cosmwasmProtoRegistry,
]),
aminoTypes: new AminoTypes({
...ibcAminoConverters,
...cosmosAminoConverters,
...osmosisAminoConverters,
...cosmwasmAminoConverters,
}),
};
},
}}
logLevel={"INFO"}
Expand Down
Loading

0 comments on commit 185531a

Please sign in to comment.