-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: npm publishing on release publish (#159)
- Loading branch information
Showing
3 changed files
with
177 additions
and
5 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,53 @@ | ||
name: NPM publish CD workflow | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
NPM-Publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.release.target_commitish }} | ||
|
||
- uses: actions/cache@v3 | ||
name: Set up cache | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- name: Set up node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16' | ||
registry-url: https://registry.npmjs.org/ | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Set publisher name | ||
run: git config --global user.name "GitHub publish bot" | ||
|
||
- name: Set publisher email | ||
run: git config --global user.email "github-publish-bot@email.com" | ||
|
||
- name: Bump the application version (package.json) | ||
run: npm version ${{ github.event.release.tag_name }} | ||
|
||
- name: Build application | ||
run: npm run build | ||
|
||
- name: Publish to NPM | ||
run: npm publish --access=public | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Push version update (package.json) | ||
run: git push | ||
env: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} |
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,113 @@ | ||
# Project config files | ||
hardhat.config.ts | ||
package-lock.json | ||
renovate.json | ||
slither.json | ||
tsconfig.json | ||
.eslintrc | ||
.github/ | ||
.husky/ | ||
.lintstagedrc | ||
.prettierignore | ||
.prettierrc | ||
.solhint.json | ||
.solhintignore | ||
|
||
# Test contracts and files | ||
test/ | ||
contracts/test | ||
|
||
# Hardhat | ||
artifacts | ||
cache | ||
|
||
# TypeChain | ||
typechain-types | ||
|
||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
|
||
# next.js build output | ||
.next | ||
|
||
# JS file output directory | ||
dist/ | ||
|
||
# IDE | ||
.vscode | ||
|
||
# Generated TS docs | ||
doc/ | ||
|
||
# Eclipse project files | ||
.project | ||
.settings | ||
|
||
# Jetbrains IDE | ||
.idea | ||
|
||
# Docker created bash file | ||
.bash_history | ||
|
||
# MacOS system files | ||
.DS_Store | ||
|
||
# OZ Cache (UUPS proxy deployment addresses) | ||
.openzeppelin | ||
|
||
# Yarn lock file (npm.lock covers this) | ||
yarn.lock | ||
yarn-error.log |
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