Skip to content

Commit

Permalink
feat: create safe api plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Niraj-Kamdar committed Oct 3, 2023
1 parent 976d0ee commit c3d7fed
Show file tree
Hide file tree
Showing 19 changed files with 14,377 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/safe-api-plugin-cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: safe-api-plugin-cd

on:
pull_request:
types: [closed]
branches:
- main

jobs:
cd:
name: safe-api-plugin-cd
if: |
github.event.pull_request.merged &&
startsWith(github.event.pull_request.title, '[CD]') != true &&
github.event.pull_request.user.login != 'github-actions'
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Read .nvmrc
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
id: nvm

- name: Read VERSION into env.RELEASE_VERSION
run: |
echo RELEASE_VERSION=$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g') >> $GITHUB_ENV
- name: Is Pre-Release
run: |
STR="${RELEASE_VERSION}"
SUB='pre.'
if [[ "$STR" == *"$SUB"* ]]; then
echo PRE_RELEASE=true >> $GITHUB_ENV
else
echo PRE_RELEASE=false >> $GITHUB_ENV
fi
- name: Setup Node.js
uses: actions/setup-node@master
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'

- name: Install dependencies
run: yarn install --nonInteractive --frozen-lockfile --prefer-offline

- name: Build
run: yarn build

- name: Auth into NPM
run: |
npm config set registry https://registry.npmjs.org/
npm config set //registry.npmjs.org/:_authToken=${{secrets.POLYWRAP_BUILD_BOT_NPM_PAT}}
echo $(npm whoami --registry https://registry.npmjs.org/)
- name: Publish To NPM (Latest)
if: env.PRE_RELEASE == 'false'
run: yarn publish:npm
env:
NPM_AUTH_TOKEN: ${{secrets.POLYWRAP_BUILD_BOT_NPM_PAT}}

- name: Publish Node Packages To NPM (Pre-Release)
if: env.PRE_RELEASE == 'true'
run: yarn publish:pre:npm
env:
NPM_AUTH_TOKEN: ${{secrets.POLYWRAP_BUILD_BOT_NPM_PAT}}
34 changes: 34 additions & 0 deletions .github/workflows/safe-api-plugin-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: safe-api-plugin-ci

on:
push:
branches:
- main
pull_request:

jobs:
ci:
name: safe-api-plugin-ci
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Read .nvmrc
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
id: nvm

- name: Setup Node.js
uses: actions/setup-node@master
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'

- name: Install dependencies
run: yarn install --nonInteractive --frozen-lockfile --prefer-offline

- name: Build
run: yarn build

- name: Test
run: yarn test
113 changes: 113 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# 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
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://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/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Project
wrap
build
.polywrap
target
__pycache__
.vscode
.idea
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18
Loading

0 comments on commit c3d7fed

Please sign in to comment.