From 002a94de1ecaddf9498030472f948aaac3074a7d Mon Sep 17 00:00:00 2001 From: Martin Kersner Date: Mon, 23 Jan 2023 19:18:36 +0900 Subject: [PATCH] NPM Package release workflow (#173) * feat: Merge contract workflows together * fix: Bump up version 0.3.2 -> 0.3.3 * fix: Missing `on` statement * fix: Remove an extra settings from pipeline * chore: Update README to trigger pipeline --- ...ld+publish.yaml => contracts.publish.yaml} | 17 +++++++++------- .../workflows/contracts.solhint+eslint.yaml | 20 ------------------- .github/workflows/contracts.test.yaml | 9 ++++++++- contracts/README.md | 10 ++++++++-- contracts/package.json | 2 +- 5 files changed, 27 insertions(+), 31 deletions(-) rename .github/workflows/{contracts.build+publish.yaml => contracts.publish.yaml} (62%) delete mode 100644 .github/workflows/contracts.solhint+eslint.yaml diff --git a/.github/workflows/contracts.build+publish.yaml b/.github/workflows/contracts.publish.yaml similarity index 62% rename from .github/workflows/contracts.build+publish.yaml rename to .github/workflows/contracts.publish.yaml index a073b1950..cee14060b 100644 --- a/.github/workflows/contracts.build+publish.yaml +++ b/.github/workflows/contracts.publish.yaml @@ -1,10 +1,7 @@ -name: "contracts: build & publish" +name: "contracts: test & build & publish" on: - push: - paths: - - "contracts/**" - # release: - # types: [created] + release: + types: [published] jobs: build: runs-on: ubuntu-latest @@ -18,11 +15,17 @@ jobs: always-auth: true - run: yarn working-directory: ./contracts + - run: yarn solhint + working-directory: ./contracts + - run: yarn eslint + working-directory: ./contracts + - run: npx hardhat test + working-directory: ./contracts - run: yarn compile working-directory: ./contracts - run: yarn build working-directory: ./contracts - - run: yarn publish + - run: yarn publish --new-version ${{ github.event.release.tag_name }} working-directory: ./contracts env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/contracts.solhint+eslint.yaml b/.github/workflows/contracts.solhint+eslint.yaml deleted file mode 100644 index b1dfc05f3..000000000 --- a/.github/workflows/contracts.solhint+eslint.yaml +++ /dev/null @@ -1,20 +0,0 @@ -name: "contracts: solhint+eslint" -on: - push: - paths: - - "contracts/**" -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: "18.12" - registry-url: "https://npm.pkg.github.com" - - run: yarn - working-directory: ./contracts - - run: yarn solhint - working-directory: ./contracts - - run: yarn eslint - working-directory: ./contracts diff --git a/.github/workflows/contracts.test.yaml b/.github/workflows/contracts.test.yaml index 9d554c67c..ae142bb1d 100644 --- a/.github/workflows/contracts.test.yaml +++ b/.github/workflows/contracts.test.yaml @@ -11,8 +11,15 @@ jobs: - uses: actions/setup-node@v3 with: node-version: "18.12" - registry-url: "https://npm.pkg.github.com" - run: yarn working-directory: ./contracts + - run: yarn solhint + working-directory: ./contracts + - run: yarn eslint + working-directory: ./contracts - run: npx hardhat test working-directory: ./contracts + - run: yarn compile + working-directory: ./contracts + - run: yarn build + working-directory: ./contracts diff --git a/contracts/README.md b/contracts/README.md index e0d5184db..5a45dc29a 100644 --- a/contracts/README.md +++ b/contracts/README.md @@ -2,16 +2,22 @@ ## Installation -``` +```shell yarn install ``` ## Compilation -``` +```shell yarn compile ``` +## Package + +```shell +yarn build +``` + ## Deployment Deployment scripts are stored in [`deploy`](deploy) directory. diff --git a/contracts/package.json b/contracts/package.json index e6e24a91f..ffa367794 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -1,6 +1,6 @@ { "name": "@bisonai-cic/icn-contracts", - "version": "0.3.2", + "version": "0.3.3", "description": "", "files": [ "./dist",