Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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)
14 changes: 14 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.0.4/schema.json",
"access": "public",
"baseBranch": "main",
"changelog": [
"@changesets/changelog-github",
{
"repo": "solana-developers/create-solana-dapp"
}
],
"commit": false,
"linked": [],
"updateInternalDependencies": "patch"
}
46 changes: 46 additions & 0 deletions .github/publish-canary-releases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Publish Canary Releases

on:
workflow_dispatch:
branches:
- main
push:
branches:
- main

env:
# See https://consoledonottrack.com/
DO_NOT_TRACK: '1'

jobs:
build-and-publish-snapshots-to-npm:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Dependencies
uses: ./.github/workflows/actions/install-dependencies

- name: Run Test & Lint
run: pnpm test

- name: Run Build Step
run: pnpm build

- name: Configure NPM token
run: |
pnpm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish Canary Release
run: |
pnpm pkg delete devDependencies
pnpm changeset version --snapshot canary
pnpm publish-packages
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
PUBLISH_TAG: canary
25 changes: 25 additions & 0 deletions .github/workflows/actions/install-dependencies/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Install Dependencies
description: Sets up Node and its package manager, then installs all dependencies

inputs:
version:
default: 'lts/*'
type: string

runs:
using: composite
steps:
- name: Install package manager
uses: pnpm/action-setup@v3
with:
version: 10.5.2

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.version }}
cache: 'pnpm'

- name: Install dependencies
shell: bash
run: pnpm install
47 changes: 47 additions & 0 deletions .github/workflows/publish-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Version & Publish Packages

on:
workflow_dispatch:
branches:
- main
push:
branches:
- main

env:
# See https://consoledonottrack.com/
DO_NOT_TRACK: '1'

jobs:
build-and-publish-to-npm:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Dependencies
uses: ./.github/workflows/actions/install-dependencies

- name: Configure NPM token
run: |
pnpm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Create Changesets Pull Request or Trigger an NPM Publish
id: changesets
uses: changesets/action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Choose Build Step
id: build-step-decider
run:
echo "step-name=${{ steps.changesets.outputs.hasChangesets == 'false' && 'publish-packages
--concurrency=${TURBO_CONCURRENCY:-1}' || 'build' }}" >> $GITHUB_OUTPUT

- name: Run Build Step
run: pnpm ${{ steps.build-step-decider.outputs.step-name }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
44 changes: 44 additions & 0 deletions .github/workflows/pull-requests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Pull requests

on:
pull_request:

env:
# Among other things, opts out of Turborepo telemetry
# See https://consoledonottrack.com/
DO_NOT_TRACK: '1'
# Some tasks slow down considerably on GitHub Actions runners when concurrency is high
TURBO_CONCURRENCY: 1

jobs:
# Needed for grouping check-web3 strategies into one check for mergify
all-pr-checks:
runs-on: ubuntu-latest
needs: build-and-test
steps:
- run: echo "Done"

build-and-test:
runs-on: ubuntu-latest

strategy:
matrix:
node:
- 'current'
- 'lts/*'

name: Build & Test on Node ${{ matrix.node }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Dependencies
uses: ./.github/workflows/actions/install-dependencies
with:
version: ${{ matrix.node }}

- name: Build
run: pnpm build

- name: Test & Lint
run: pnpm test
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,15 @@
"dev": "vitest dev",
"lint": "eslint . && prettier -c .",
"lint:fix": "automd && eslint . --fix && prettier -w .",
"prepack": "pnpm build",
"release": "pnpm build && pnpm test && npm publish --tag latest && git push --follow-tags",
"release:next": "pnpm build && pnpm test && npm publish --tag next && git push --follow-tags",
"prepublishOnly": "pnpm pkg delete devDependencies",
"publish-impl": "npm view $npm_package_name@$npm_package_version > /dev/null 2>&1 || pnpm publish --tag ${PUBLISH_TAG:-canary} --access public --no-git-checks",
"publish-packages": "pnpm prepublishOnly && pnpm publish-impl",
"test": "pnpm lint && pnpm test:types && vitest run --coverage",
"test:types": "tsc --noEmit --skipLibCheck"
},
"devDependencies": {
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.10",
"@types/mock-fs": "^4.13.4",
"@types/node": "^22.13.1",
"@types/semver": "^7.5.8",
Expand Down
Loading