Skip to content

Commit

Permalink
build: automatically publish to NPM if tag is created
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanVerbner committed Sep 27, 2023
1 parent fbd3837 commit 59e955a
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 7 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Node.js Package

on:
push:
tags:
- 'v*'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm test
- run: npm run build
- name: Check version
run: |
TAG_VERSION=${GITHUB_REF#refs/tags/v}
PACKAGE_VERSION=$(node -p "require('./package.json').version")
if [ "$TAG_VERSION" != "$PACKAGE_VERSION" ]; then
echo "Tag version ($TAG_VERSION) does not match package.json version ($PACKAGE_VERSION)"
exit 1
fi
- run: npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Mina Testing Utils

⚠️ This todo is incomplete and not ready for use ⚠ ️

This repository contains a set of utilities for testing Mina zkapps:

- Custom jest matchers
Expand All @@ -18,16 +16,16 @@ This repository contains a set of utilities for testing Mina zkapps:
In order to use this tool, you should install it as a dev dependency on your existing project, for example, one created using `zkcli-app`:

```bash
npm --save-dev install mina-jest-matchers #TODO
npm --save-dev install @atixlabs/mina-testing-utils
```

## Using Jest matchers

Import it in your tests as follows:

```typescript
// Impor to extend the matchers
import 'mina-jest-matchers';
// Import to extend the matchers
import '@atixlabs/mina-testing-utils';

describe('my test', () => {

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "mina-testing-utils",
"name": "@atixlabs/mina-testing-utils",
"version": "0.0.1",
"description": "Handful MINA testing utilx to be used alongside with zkapp-cli generated projects",
"main": "lib/index.js",
Expand All @@ -14,7 +14,7 @@
"build:cli": "cp -r ./cli ./dist/",
"dev-pack": "npm run build && npm pack ./dist/"
},
"author": "Globant",
"author": "Atixlabs",
"license": "MIT",
"devDependencies": {
"@jest/globals": "29.6.2",
Expand Down

0 comments on commit 59e955a

Please sign in to comment.