Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions .eslintrc.js

This file was deleted.

6 changes: 0 additions & 6 deletions .github/CODEOWNERS

This file was deleted.

34 changes: 0 additions & 34 deletions .github/workflows/main.yml

This file was deleted.

55 changes: 55 additions & 0 deletions .github/workflows/onPushToMain.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: version, tag and github release
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wileyj the oclif generate .. command used to update the CLI libraries added these release automation workflows. The code looks fine to me, but some repo secrets need to be added for it to work. Thoughts?


on:
push:
branches: [main]

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Check if version already exists
id: version-check
run: |
package_version=$(node -p "require('./package.json').version")
exists=$(gh api repos/${{ github.repository }}/releases/tags/v$package_version >/dev/null 2>&1 && echo "true" || echo "")

if [ -n "$exists" ];
then
echo "Version v$package_version already exists"
echo "::warning file=package.json,line=1::Version v$package_version already exists - no release will be created. If you want to create a new release, please update the version in package.json and push again."
echo "skipped=true" >> $GITHUB_OUTPUT
else
echo "Version v$package_version does not exist. Creating release..."
echo "skipped=false" >> $GITHUB_OUTPUT
echo "tag=v$package_version" >> $GITHUB_OUTPUT
fi
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Setup git
if: ${{ steps.version-check.outputs.skipped == 'false' }}
run: |
git config --global user.email ${{ secrets.GH_EMAIL }}
git config --global user.name ${{ secrets.GH_USERNAME }}
- name: Generate oclif README
if: ${{ steps.version-check.outputs.skipped == 'false' }}
id: oclif-readme
run: |
npm install
npm exec oclif readme
if [ -n "$(git status --porcelain)" ]; then
git add .
git commit -am "chore: update README.md"
git push -u origin ${{ github.ref_name }}
fi
- name: Create Github Release
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5
if: ${{ steps.version-check.outputs.skipped == 'false' }}
with:
name: ${{ steps.version-check.outputs.tag }}
tag: ${{ steps.version-check.outputs.tag }}
commit: ${{ github.ref_name }}
token: ${{ secrets.GH_TOKEN }}
skipIfReleaseExists: true
21 changes: 21 additions & 0 deletions .github/workflows/onRelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: publish
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wileyj same here


on:
release:
types: [released]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- run: npm install
- run: npm run build
- run: npm run prepack
- uses: JS-DevTools/npm-publish@19c28f1ef146469e409470805ea4279d47c3d35c
with:
token: ${{ secrets.NPM_TOKEN }}
- run: npm run postpack
23 changes: 23 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: tests
on:
push:
branches-ignore: [main]
workflow_dispatch:

jobs:
unit-tests:
strategy:
matrix:
os: ['ubuntu-latest', 'windows-latest']
node_version: [lts/-1, lts/*, latest]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
cache: npm
- run: npm install
- run: npm run build
- run: npm run test
19 changes: 14 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
*.log
.DS_Store
node_modules
dist
lib
*-debug.log
*-error.log
**/.DS_Store
/.idea
/dist
/tmp
/node_modules
oclif.manifest.json



yarn.lock
pnpm-lock.yaml

11 changes: 11 additions & 0 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"require": [
"ts-node/register"
],
"watch-extensions": [
"ts"
],
"recursive": true,
"reporter": "spec",
"timeout": 60000
}
1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"@oclif/prettier-config"
87 changes: 70 additions & 17 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,85 @@
"version": "0.2.0",
"configurations": [
{
"name": "Test",
"type": "node",
"request": "launch",
"name": "Deploy send-many-memo contract",
"preLaunchTask": "npm: build",
"runtimeArgs": [
"${workspaceRoot}/node_modules/.bin/mocha",
"--forbid-only",
"test/**/*.test.ts",
// "--grep", "runs send-many mainnet"
],
},
{
"type": "node",
"request": "launch",
"name": "deploy-contract send-many-memo testnet",
"skipFiles": ["<node_internals>/**"],
"program": "${workspaceFolder}/bin/dev.js",
"args": [
"deploy-contract",
"send-many-memo",
"-n=testnet",
"-k=00000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
],
},
{
"type": "node",
"request": "launch",
"name": "deploy-contract send-many-memo mainnet",
"skipFiles": ["<node_internals>/**"],
"program": "${workspaceFolder}/bin/dev.js",
"args": [
"deploy-contract",
"send-many-memo",
"-n=mainnet",
"-k=00000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
],
},
{
"type": "node",
"request": "launch",
"name": "send-many-memo testnet",
"skipFiles": ["<node_internals>/**"],
"program": "${workspaceFolder}/bin/dev.js",
"args": [
"send-many-memo",
"STADMRP577SC3MCNP7T3PRSTZBJ75FJ59JGABZTW,1,hello",
"ST2WPFYAW85A0YK9ACJR8JGWPM19VWYF90J8P5ZTH,5,memo2",
"--jsonOutput",
"-n=testnet",
"-k=00000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
],
},
{
"type": "node",
"request": "launch",
"name": "send-many-memo mainnet",
"skipFiles": ["<node_internals>/**"],
"program": "${workspaceFolder}/bin/dev.js",
"args": [
"${workspaceFolder}/src/start.ts",
"deploy-contract", "send-many-memo",
"-n=testnet",
"--broadcast",
"-k=<YOUR_PRIVATE_KEY>",
"send-many-memo",
"SP16MQDBJB2BF21PJGX72R5XA1C32MY747ZSAR1QY,1,hello",
"SP2TA4FGB43WVAS8MVS6YCWTSN2BZNQ1ASGEAKSDD,5,memo2",
"--jsonOutput",
"-n=mainnet",
"-k=00000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
],
"outputCapture": "std",
},
{
"type": "node",
"request": "launch",
"name": "Perform send-many-memo contract-call",
"preLaunchTask": "npm: build",
"name": "send-many-memo-safe testnet",
"skipFiles": ["<node_internals>/**"],
"program": "${workspaceFolder}/bin/dev.js",
"args": [
"${workspaceFolder}/bin/run",
"send-many-memo", "STADMRP577SC3MCNP7T3PRSTZBJ75FJ59JGABZTW,1,hello", "ST2WPFYAW85A0YK9ACJR8JGWPM19VWYF90J8P5ZTH,5,memo2",
"-n=testnet",
"--broadcast",
"-k=<YOUR_PRIVATE_KEY>",
"send-many-memo-safe",
"ST3F1X4QGV2SM8XD96X45M6RTQXKA1PZJZZCQAB4B,1",
"--jsonOutput",
"-n=testnet",
"-k=00000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
],
"outputCapture": "std"
}
},
]
}
Loading