diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..0bc518d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,18 @@ +name: Node.js CI + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: 20 + - run: npm test diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..c984fca --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,17 @@ +name: Publish Package to npm +on: + release: + types: + - released +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 20 + registry-url: https://registry.npmjs.org + - run: npm publish --access=public --provenance + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..ed037fd --- /dev/null +++ b/.npmignore @@ -0,0 +1,4 @@ +.github + +json-to-go.test.js +sample.json diff --git a/package.json b/package.json new file mode 100644 index 0000000..bb36bfd --- /dev/null +++ b/package.json @@ -0,0 +1,26 @@ +{ + "name": "json-to-go", + "version": "1.0.0", + "description": "convert JSON to Go struct", + "homepage": "https://mholt.github.io/json-to-go/", + "author": { + "name": "Matt Holt", + "url": "https://matt.life" + }, + "repository": { + "type": "git", + "url": "https://github.com/mholt/json-to-go.git" + }, + "license": "MIT", + "keywords": [ + "json", + "go", + "golang" + ], + "main": "json-to-go.js", + "dependencies": {}, + "devDependencies": {}, + "scripts": { + "test": "node json-to-go.test.js" + } +}