Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add changesets and release workflow #410

Merged
merged 8 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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@3.0.0/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
9 changes: 9 additions & 0 deletions .changeset/old-shrimps-share.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@delvtech/council-artifacts": patch
"@delvtech/council-ethers": patch
"@delvtech/council-core": patch
"@delvtech/council-viem": patch
"@delvtech/council-cli": patch
---

Initial release 🚀
29 changes: 18 additions & 11 deletions .github/workflows/gh-pages-council.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
branches: ["main"]
paths:
- "apps/council-ui/**"
- ".github/workflows/deploy-council-ui-to-gh-pages.yml"
- ".github/workflows/gh-pages-council.yml"

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -26,23 +26,26 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
- name: Check out code
uses: actions/checkout@v4

- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: "16"
node-version: 20
cache: "yarn"

- name: Setup Pages
uses: actions/configure-pages@v2
uses: actions/configure-pages@v4
with:
# Automatically inject basePath in your Next.js configuration file and disable
# server side image optimization (https://nextjs.org/docs/api-reference/next/image#unoptimized).
#
# You may remove this line if you want to manage the configuration yourself.
static_site_generator: next

- name: Restore cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
apps/council-ui/.next/cache
Expand All @@ -51,16 +54,20 @@ jobs:
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-

- name: Install dependencies
run: yarn

- name: Build with Next.js
env:
NEXT_PUBLIC_MAINNET_ALCHEMY_KEY: ${{ secrets.MAINNET_ALCHEMY_KEY }}
NEXT_PUBLIC_GOERLI_ALCHEMY_KEY: ${{ secrets.GOERLI_ALCHEMY_KEY }}
NEXT_PUBLIC_MAINNET_RPC_URL: ${{ secrets.MAINNET_RPC_URL }}
NEXT_PUBLIC_GOERLI_RPC_URL: ${{ secrets.GOERLI_RPC_URL }}
NEXT_PUBLIC_COUNCIL_UI_BASE_PATH: ${{ secrets.COUNCIL_UI_BASE_PATH }}
run: npx turbo run build --filter=council-ui

- name: Static HTML export of Next.js
run: yarn workspace council-ui run export

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
Expand All @@ -76,4 +83,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
uses: actions/deploy-pages@v4
2 changes: 0 additions & 2 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Setup Node.js environment
uses: actions/setup-node@v4
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Release

on:
push:
branches:
- main

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

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'

- name: Install dependencies
run: yarn --frozen-lockfile

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
commit: 'chore: version packages'
title: 'chore: version packages'
publish: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18
20
4 changes: 2 additions & 2 deletions apps/council-sdk-starter/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "council-sdk-starter",
"version": "0.0.1",
"version": "0.0.0",
"description": "Boilerplate to get started using the council-sdk fast!",
"license": "MIT",
"private": true,
Expand All @@ -14,7 +14,7 @@
"getProposalResults": "tesm-node -r dotenv/config src/scripts/getProposalResults.ts"
},
"dependencies": {
"@delvtech/council-viem": "*",
"@delvtech/council-viem": "^0.0.0",
"viem": "^2.7.12"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions apps/council-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@delvtech/council-artifacts": "*",
"@delvtech/council-viem": "*",
"@delvtech/council-artifacts": "^0.0.0",
"@delvtech/council-viem": "^0.0.0",
"@ensdomains/ensjs": "^3.4.4",
"@heroicons/react": "^2.1.1",
"@metamask/jazzicon": "^2.0.0",
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
"format:check": "turbo run format:check",
"typecheck": "turbo run typecheck",
"postinstall": "husky install",
"test": "turbo test"
"test": "turbo test",
"release": "turbo build && changeset publish"
},
"devDependencies": {
"@changesets/cli": "^2.27.1",
"eslint": "^8.56.0",
"husky": "^8.0.1",
"lint-staged": "^13.0.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/council-artifacts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@delvtech/council-artifacts",
"version": "1.0.1",
"version": "0.0.0",
"license": "MIT",
"type": "module",
"files": [
Expand Down
6 changes: 3 additions & 3 deletions packages/council-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@delvtech/council-cli",
"version": "0.0.1",
"version": "0.0.0",
"license": "MIT",
"type": "module",
"main": "dist/council.js",
Expand All @@ -16,8 +16,8 @@
"watch": "tsc --watch"
},
"dependencies": {
"@delvtech/council-artifacts": "*",
"@delvtech/council-viem": "*",
"@delvtech/council-artifacts": "^0.0.0",
"@delvtech/council-viem": "^0.0.0",
"ajv": "^8.12.0",
"cfonts": "^3.2.0",
"cli-table": "^0.3.11",
Expand Down
4 changes: 2 additions & 2 deletions packages/council-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@delvtech/council-core",
"version": "0.0.1",
"version": "0.0.0",
"license": "MIT",
"type": "module",
"scripts": {
Expand All @@ -16,7 +16,7 @@
"@delvtech/evm-client": "^0.1.1"
},
"dependencies": {
"@delvtech/council-artifacts": "*",
"@delvtech/council-artifacts": "^0.0.0",
"big.js": "^6.2.1",
"fast-json-stable-stringify": "^2.1.0",
"lru-cache": "^10.2.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/council-ethers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"ethers": ">=6"
},
"dependencies": {
"@delvtech/council-core": "*",
"@delvtech/council-core": "0.0.0",
"@delvtech/evm-client-ethers": "^0.1.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/council-viem/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"viem": ">=2"
},
"dependencies": {
"@delvtech/council-core": "*",
"@delvtech/council-core": "0.0.0",
"@delvtech/evm-client-viem": "^0.1.1"
},
"devDependencies": {
Expand Down
1 change: 1 addition & 0 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@council/eslint-config",
"version": "0.0.0",
"private": true,
"main": ".eslintrc.js",
"license": "MIT",
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/tsconfig/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@council/tsconfig",
"version": "1.0.0",
"version": "0.0.0",
"private": true,
"files": [
"base.json",
Expand Down
Loading