diff --git a/.github/workflows/changesets.yml b/.github/workflows/changesets.yml new file mode 100644 index 0000000..abd7813 --- /dev/null +++ b/.github/workflows/changesets.yml @@ -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 }} diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 0f63bf7..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,7 +0,0 @@ -# @zoralabs/nft-drop-contracts - -## 1.12.1 - -### Patch Changes - -- Publishing abi and addresses to typescript importable code in the package diff --git a/DEPLOYING.md b/DEVELOPING.md similarity index 67% rename from DEPLOYING.md rename to DEVELOPING.md index dafa5e6..70eda33 100644 --- a/DEPLOYING.md +++ b/DEVELOPING.md @@ -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. @@ -38,14 +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. Published abis and new addresses node package. - -Create a new changeset relase: - - yarn changeset - -Then publish the new package: - - yarn publish + node js-scripts/copy-latest-deployment-addresses.mjs deploy \ No newline at end of file