Skip to content

Commit

Permalink
added changeset github action with npm publish
Browse files Browse the repository at this point in the history
updated development instructions
remove changelog
  • Loading branch information
oveddan committed Jun 29, 2023
1 parent 008654a commit 17ab14e
Show file tree
Hide file tree
Showing 11 changed files with 5,631 additions and 2,195 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
40 changes: 40 additions & 0 deletions .github/workflows/changesets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release

on:
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'

- name: Install project dependencies
run: yarn

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

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ cache
dist/
out/
.idea
broadcast/
broadcast/
package/wagmiGenerated.ts
package/chainConfigs.ts
17 changes: 13 additions & 4 deletions DEPLOYING.md → DEVELOPING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
# Deploying to a new chain
# Development/Deploying workflow

## Development workflow

1. Open a PR with changes
2. Run `npx changeset` to generate a new changeset
3. If changes are approved and merged, a github action will open a PR "Version Packages" and create a corresponding branch `changeset-release/changeset`
4. If a deployment of the contracts should to be done that would affect the deployed contract addresses, checkout the branch `changeset-release/changeset`,
*follow the deployment steps below,* commit changes, and push that branch, which will contain the updated deployed addresses.
5. Merge the PR "Version Packages" to master, which will trigger a github action to publish the new packages to npm.

## Deploying to a new chain

### 1. Setup `chainConfigs` file.

Expand Down Expand Up @@ -38,6 +49,4 @@ Use your own RPC configuration variables

Copies new addresses over to `addresses` folder:

node js-scripts/copy-latest-deployment-addresses.mjs deploy

### 4. Update node
node js-scripts/copy-latest-deployment-addresses.mjs deploy
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@
"coverage": "forge coverage --report lcov",
"build": "forge build",
"build-ts": "tsup package/index.ts --format cjs --dts --sourcemap",
"bundle-configs": "node js-scripts/bundle-chainConfigs.mjs && yarn format",
"bundle-configs": "node js-scripts/bundle-chainConfigs.mjs",
"prettier": "npx prettier \"js-scripts/**/*.mjs\" \"package/**/*.ts\" \"wagmi.config.ts\" --check",
"prettier:fix": "npm run prettier -- --write",
"wagmi": "wagmi generate",
"storage-inspect:check": "./script/storage-check.sh check ERC721Drop ERC721DropProxy FactoryUpgradeGate ZoraNFTCreatorProxy ZoraNFTCreatorV1",
"storage-inspect:generate": "./script/storage-check.sh generate ERC721Drop ERC721DropProxy FactoryUpgradeGate ZoraNFTCreatorProxy ZoraNFTCreatorV1"
},
"devDependencies": {
"@changesets/cli": "^2.26.1",
"@ethersproject/abi": "^5.7.0",
"@ethersproject/address": "^5.7.0",
"@ethersproject/bytes": "^5.7.0",
Expand Down
68 changes: 0 additions & 68 deletions package/chainConfigs.ts

This file was deleted.

4 changes: 3 additions & 1 deletion package/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
export * from './wagmiGenerated';
export { chainConfigs } from './chainConfigs';
import { chainConfigs } from './chainConfigs';

export { chainConfigs as chainConfigs };
Loading

0 comments on commit 17ab14e

Please sign in to comment.