-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from thesis/publish-to-npm
Add a GH Actions workflow publishing npm package with contracts Contracts stored in the `thesis/solidity-contracts` repository are used as a dependency in other projects. Currently they are pulled from the GitHub and referenced to by commit hash. In this PR we add a GH Actions workflow that will publish npm packages containing `*.sol` contracts and version them using `-pre.X` suffix.
- Loading branch information
Showing
2 changed files
with
49 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: NPM | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "contracts/**" | ||
- "package.json" | ||
- "yarn.lock" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
npm-compile-publish-contracts: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: "14.x" | ||
cache: "yarn" | ||
registry-url: "https://registry.npmjs.org" | ||
|
||
- name: Bump up package version | ||
id: npm-version-bump | ||
uses: keep-network/npm-version-bump@v2 | ||
with: | ||
environment: pre | ||
branch: ${{ github.ref }} | ||
commit: ${{ github.sha }} | ||
|
||
- name: Publish package | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: npm publish --access public --tag pre |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,18 @@ | ||
{ | ||
"name": "@thesis/solidity-contracts", | ||
"version": "0.0.1", | ||
"name": "@thesis-co/solidity-contracts", | ||
"version": "0.0.1-pre", | ||
"license": "MIT", | ||
"files": [ | ||
"contracts/**/*.sol" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "ssh://[email protected]/thesis/solidity-contracts" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/thesis/solidity-contracts/issues" | ||
}, | ||
"homepage": "https://github.com/thesis/solidity-contracts", | ||
"scripts": { | ||
"build": "hardhat compile", | ||
"format": "npm run lint && prettier --check .", | ||
|