Skip to content

Commit

Permalink
Merge pull request #201 from ensdomains/changesets
Browse files Browse the repository at this point in the history
Changesets
  • Loading branch information
talentlessguy authored Sep 20, 2024
2 parents 32a28d1 + 3ee3713 commit e932a19
Show file tree
Hide file tree
Showing 6 changed files with 2,039 additions and 591 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": false,
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
79 changes: 39 additions & 40 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,56 +1,55 @@
name: Publish
name: Release

on:
release:
types: [published]
push:
branches:
- main

defaults:
run:
shell: bash

env:
FORCE_COLOR: true

jobs:
publish:
name: Publish
changelog:
name: PR or Release
if: ${{ github.repository_owner == 'ensdomains' }}
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18]
id-token: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.release.target_commitish }}

- uses: pnpm/action-setup@v4
with:
version: 9.4.0
- uses: actions/checkout@v4
- name: Enable corepack
run: corepack enable pnpm

- name: Install Node.js
uses: actions/setup-node@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
node-version: 18
registry-url: 'https://registry.npmjs.org'

- run: pnpm install --frozen-lockfile
- name: Install dependencies
run: pnpm install

- name: Set up git
run: |
git config --local user.email '41898282+github-actions[bot]@users.noreply.github.com'
git config --local user.name 'github-actions[bot]'
- name: Build Packages
run: pnpm -r build

- name: Bump version to ${{ github.event.release.tag_name }}
run: |
pnpm -F @ensdomains/ensjs ver ${{ github.event.release.tag_name }}
git add .
git commit -m "${{ github.event.release.tag_name }}"
- name: Publish
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true
run: |
pnpm config set //registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}
pnpm -F @ensdomains/ensjs publish
- name: Push changes
run: git push
- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
# Note: pnpm install after versioning is necessary to refresh lockfile
version: chgset:version
publish: pnpm release
commit: "chore: release"
title: "[ci] release"
env:
github-token: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Needs access to publish to npm
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true
12 changes: 3 additions & 9 deletions examples/basic-tsnode-esm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,8 @@
},
"dependencies": {
"@ensdomains/ensjs": "workspace:*",
"ts-node": "^10.7.0",
"typescript": "^5.0.4",
"viem": "^1.2.9",
"node-fetch": "2.6.7"
},
"pnpm": {
"overrides": {
"node-fetch": "2.6.7"
}
"ts-node": "^10.9.2",
"typescript": "^5.6.2",
"viem": "^2.21.9"
}
}
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@
],
"scripts": {
"publish:local:ens-test-env": "yalc publish packages/ens-test-env --push --up",
"publish:local:ensjs": "yalc publish packages/ensjs --push --up"
"publish:local:ensjs": "yalc publish packages/ensjs --push --up",
"chgset:version": "changeset version && pnpm install",
"chgset:run": "changeset",
"release": "changeset publish",
"chgset": "pnpm chgset:run && pnpm chgset:version"
},
"devDependencies": {
"@changesets/cli": "^2.27.8",
"@typescript-eslint/eslint-plugin": "^6.7.5",
"@typescript-eslint/parser": "^6.7.5",
"eslint": "^8.51.0",
Expand Down
Loading

0 comments on commit e932a19

Please sign in to comment.