Skip to content

Commit

Permalink
chore: publish to github packages (#2)
Browse files Browse the repository at this point in the history
* chore: swap tsup for parcel

* chore: add changesets

* ci: publish to npm and github packages

* chore: use latest version of sdk

* chore: prettier

* chore: update pkg version
  • Loading branch information
nickadamson authored Nov 17, 2023
1 parent fe1b6c0 commit 3071583
Show file tree
Hide file tree
Showing 10 changed files with 3,255 additions and 1,956 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/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
25 changes: 20 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Install packages, compile SDK, and build docs
run: |
pnpm i
pnpm build
pnpm codegen
pnpm gen-docs
- name: Deploy Docs to Github Pages
Expand All @@ -36,13 +36,28 @@ jobs:
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
run: pnpm audit signatures

# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
- name: Setup .npmrc file to publish to npm
uses: actions/setup-node@v4
with:
node-version: '18.x'
node-version: 18
registry-url: 'https://registry.npmjs.org'
scope: '@valorem-labs-inc'

- name: Publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm publish --access public --no-git-checks
run: pnpm ci:release

- name: Setup .npmrc for publishing to github packages
uses: actions/setup-node@v4
with:
node-version: 18
registry-url: 'https://npm.pkg.github.com'
scope: '@valorem-labs-inc'

# Runs changeset version to see if pkg v needs bumped
# () || true prevents exit code 1 when there is no v bump needed
- name: Publish to Github Packages
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: pnpm ci:release
5 changes: 0 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
name: Test

on:
push:
branches:
- main
- 'v**'
- 'releases/v**'
pull_request:
types: [opened, synchronize, reopened]
branches:
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ coverage
src/lib/codegen
src/lib/trade-interfaces

docs
docs

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# @valorem-labs-inc/react-hooks

## 0.0.2

### Patch Changes

- chore: update release process
drop tsup for parcel
update workflow to deploy to npm and github packages
30 changes: 11 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,18 @@
{
"name": "@valorem-labs-inc/react-hooks",
"version": "0.0.1-alpha.0",
"version": "0.0.2",
"repository": {
"type": "git",
"url": "https://github.com/valorem-labs-inc/react-hooks.git"
},
"license": "MIT",
"sideEffects": false,
"type": "module",
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"./package.json": "./package.json"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"/dist"
],
"main": "dist/main.js",
"source": "src/index.ts",
"types": "dist/types.d.ts",
"scripts": {
"build": "pnpm clean && pnpm codegen && pnpm tsup",
"build": "pnpm clean && pnpm codegen && pnpm parcel build --no-cache",
"ci:release": "pnpm build && pnpm changeset publish",
"clean": "rm -rf ./dist",
"codegen": "rm -rf ./src/lib/codegen && wagmi generate && npx buf generate",
"format": "prettier --write \"**/*.{ts,tsx,md,json}\"",
Expand All @@ -39,7 +30,7 @@
"@connectrpc/connect-web": "^1.1.2",
"@tanstack/query-core": "^4.36.1",
"@tanstack/react-query": "^4.36.1",
"@valorem-labs-inc/sdk": "0.0.2-alpha.0",
"@valorem-labs-inc/sdk": "0.0.3",
"@wagmi/cli": "^1.5.2",
"@wagmi/core": "^1.4.5",
"abitype": "0.8.7",
Expand All @@ -51,7 +42,10 @@
"devDependencies": {
"@bufbuild/buf": "^1.27.1",
"@bufbuild/protoc-gen-es": "^1.3.3",
"@changesets/cli": "^2.26.2",
"@connectrpc/protoc-gen-connect-query": "^0.5.3",
"@parcel/packager-ts": "2.10.3",
"@parcel/transformer-typescript-types": "2.10.3",
"@testing-library/react": "^14.0.0",
"@testing-library/react-hooks": "^8.0.1",
"@types/node": "^20.8.7",
Expand All @@ -63,12 +57,10 @@
"happy-dom": "^12.9.1",
"jest-environment-jsdom": "^29.7.0",
"jsdom": "^22.1.0",
"parcel": "^2.10.3",
"prettier": "^3.0.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"semantic-release": "^22.0.5",
"ts-node": "^10.9.1",
"tsup": "^7.2.0",
"typedoc": "^0.25.2",
"typedoc-plugin-missing-exports": "^2.1.0",
"typescript": "^5.2.2",
Expand Down
Loading

0 comments on commit 3071583

Please sign in to comment.