Skip to content

Commit

Permalink
chore(infra): set up ci and npm deploy (#440)
Browse files Browse the repository at this point in the history
* chore(infra): set up ci and npm deploy

* Create package.json

* add bug bounty url and keywords

---------

Co-authored-by: gretzke <daniel@gretzke.de>
  • Loading branch information
mr-uniswap and gretzke authored Feb 5, 2025
1 parent 4d85e04 commit 04263e9
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 2 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Release
on:
# manual trigger
workflow_dispatch:

jobs:
deploy:
name: release
runs-on:
group: npm-deploy
environment:
name: release
permissions:
id-token: write
contents: write
steps:
- name: Load secret
uses: 1password/load-secrets-action@581a835fb51b8e7ec56b71cf2ffddd7e68bb25e0
with:
# Export loaded secrets as environment variables
export-env: true
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
# You may need to change this to your vault name and secret name
# Refer to it by calling env.NPM_TOKEN
# This token is also limited by IP to ONLY work on the runner
NPM_TOKEN: op://npm-deploy/npm-runner-token/secret

- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744

- name: Setup Node
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7
with:
cache: yarn
node-version: 18
registry-url: "https://registry.npmjs.org"

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: stable

- name: Install dependencies
run: |
yarn install --immutable --immutable-cache
git submodule update --init --recursive
- name: Compile
run: forge build

- name: Release
env:
NPM_CONFIG_USERCONFIG: /dev/null
NODE_AUTH_TOKEN: ${{ env.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > ~/.npmrc && yarn publish
2 changes: 1 addition & 1 deletion .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- main
schedule:
# random HH:MM to avoid a load spike on GitHub Actions at 00:00
- cron: '35 11 * * *'
- cron: "35 11 * * *"
jobs:
semgrep:
name: semgrep/ci
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
uses: foundry-rs/foundry-toolchain@v1
with:
version: stable

- name: Run tests
run: forge test --isolate -vvv
env:
Expand Down
23 changes: 23 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "@uniswap/v4-periphery",
"version": "1.0.0",
"description": "🦄 Peripheral smart contracts for interacting with Uniswap v4",
"repository": {
"type": "git",
"url": "git+https://github.com/Uniswap/v4-periphery.git"
},
"license": "MIT",
"bugs": {
"url": "https://uniswap.org/bug-bounty"
},
"homepage": "https://github.com/Uniswap/v4-periphery#readme",
"publishConfig": {
"access": "public",
"provenance": true
},
"keywords": [
"uniswap",
"periphery",
"v4"
]
}

0 comments on commit 04263e9

Please sign in to comment.