Skip to content

Commit

Permalink
chore: publish to github packages (#12)
Browse files Browse the repository at this point in the history
* chore: add changesets

* chore: swap tsup for parcel

* chore: bump deps

* ci: publish to npm & github packages

* chore: update pkg version
  • Loading branch information
nickadamson authored Nov 17, 2023
1 parent 5a7d80c commit c2a7598
Show file tree
Hide file tree
Showing 16 changed files with 2,896 additions and 653 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": []
}
28 changes: 22 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ on:
types: [released]

permissions:
contents: write # for github pages
packages: write
contents: write

jobs:
release:
Expand All @@ -25,7 +26,6 @@ jobs:
- name: Install packages, compile SDK, and build docs
run: |
pnpm i
pnpm build
pnpm gen-docs
- name: Deploy Docs to Github Pages
Expand All @@ -36,13 +36,29 @@ 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
8 changes: 8 additions & 0 deletions .parcelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "@parcel/config-default",
"transformers": {
"*.ts": [
"@parcel/transformer-typescript-tsc"
]
}
}
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/sdk

## 0.0.3

### Patch Changes

- 3536739: chore: update release process
drop tsup for parcel
update workflow to deploy to npm and github packages
39 changes: 15 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,19 @@
{
"name": "@valorem-labs-inc/sdk",
"version": "0.0.2-alpha.1",
"version": "0.0.3",
"repository": {
"type": "git",
"url": "https://github.com/valorem-labs-inc/typescript-sdk.git"
},
"license": "MIT",
"sideEffects": false,
"type": "module",
"exports": {
".": {
"types": "./dist/_esm/index.d.ts",
"import": "./dist/_esm/index.js",
"default": "./dist/_cjs/index.js"
},
"./package.json": "./package.json"
},
"main": "./dist/_cjs/index.js",
"module": "./dist/_esm/index.js",
"types": "./dist/_esm/index.d.ts",
"typings": "./dist/_esm/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 build:cjs && pnpm build:esm",
"build:cjs": "pnpm tsup --config tsup.cjs.ts",
"build:esm": "pnpm tsup --config tsup.esm.ts",
"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 && npx buf generate",
"format": "prettier --write \"**/*.{ts,tsx,md,json}\"",
Expand All @@ -41,24 +28,28 @@
"@bufbuild/buf": "^1.28.1",
"@bufbuild/protobuf": "^1.4.2",
"@connectrpc/connect": "^1.1.3",
"@wagmi/core": "^1.4.4"
"@wagmi/core": "^1.4.7"
},
"devDependencies": {
"@bufbuild/protoc-gen-es": "^1.4.2",
"@changesets/cli": "^2.26.2",
"@connectrpc/connect-node": "^1.1.3",
"@connectrpc/connect-web": "^1.1.3",
"@connectrpc/protoc-gen-connect-es": "^1.1.3",
"@types/node": "^20.9.0",
"@parcel/config-default": "^2.10.3",
"@parcel/packager-ts": "2.10.3",
"@parcel/transformer-typescript-tsc": "^2.10.3",
"@parcel/transformer-typescript-types": "2.10.3",
"@types/node": "^20.9.1",
"@vercel/style-guide": "^5.1.0",
"@vitest/coverage-v8": "^0.34.6",
"eslint": "^8.53.0",
"parcel": "^2.10.3",
"prettier": "^3.1.0",
"ts-node": "^10.9.1",
"tsup": "^7.2.0",
"typedoc": "^0.25.3",
"typedoc-plugin-missing-exports": "^2.1.0",
"typescript": "^5.2.2",
"viem": "^1.19.1",
"viem": "^1.19.3",
"vitest": "^0.34.6"
},
"peerDependencies": {
Expand Down
Loading

0 comments on commit c2a7598

Please sign in to comment.