diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 0000000..6cdebaf --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,33 @@ +# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created +# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages + +name: Node.js Package + +on: + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - run: npm ci + - run: npm test + + publish-npm: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + registry-url: https://registry.npmjs.org/ + - run: npm ci + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.npm_token}} diff --git a/truffle-config.js b/truffle-config.js index ae6e17b..dfcd480 100644 --- a/truffle-config.js +++ b/truffle-config.js @@ -1,6 +1,3 @@ -require('dotenv').config(); - - const mnemonic = process.env.MNEMONIC; const HDWalletProvider = require("@truffle/hdwallet-provider"); @@ -9,7 +6,7 @@ module.exports = { networks: { development: { host: "127.0.0.1", - port: 8545, + port: 8545, network_id: "*" // Match any network id }, polygon: { @@ -25,17 +22,4 @@ module.exports = { confirmations: 2, timeoutBlocks: 200, skipDryRun: true - } - - }, - contracts_directory: './src/contracts/', - contracts_build_directory: './src/abis/', - compilers: { - solc: { - optimizer: { - enabled: true, - runs: 200 - }, - } - } -} + } \ No newline at end of file