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

ci: add changeset #66

Merged
merged 4 commits into from
Jan 13, 2025
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/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "draft",
"updateInternalDependencies": "patch",
"ignore": []
}
31 changes: 31 additions & 0 deletions .github/actions/setup-node-pnpm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: 'Setup Node.js and pnpm'

inputs:
node-version:
type: string
default: '22'
description: 'The version of Node.js to use'

pnpm-version:
type: string
default: '10.0.0+sha512.b8fef5494bd3fe4cbd4edabd0745df2ee5be3e4b0b8b08fa643aa3e4c6702ccc0f00d68fa8a8c9858a735a0032485a44990ed2810526c875e416f001b17df12b'
description: 'The version of pnpm to use'

runs:
using: "composite"
steps:
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ inputs.pnpm-version }}
run_install: false

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

- name: Install dependencies
run: pnpm install
shell: bash
40 changes: 3 additions & 37 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,53 +8,19 @@ on:
types: [opened, synchronize, reopened]

env:
NODE_VERSION: '22'
PNPM_VERSION: '9'
TEST_EAS_PRIVATE_KEY: ${{ secrets.TEST_EAS_PRIVATE_KEY }}
TEST_USER_PRIVATE_KEY: ${{ secrets.TEST_USER_PRIVATE_KEY }}

jobs:
check:
name: Run tests and format checks
runs-on: ubuntu-latest

steps:
- name: Checkout PR head
- name: Checkout
uses: actions/checkout@v4

- name: Fetch base commit
run: |
git fetch origin ${{ github.event.pull_request.base.sha }} --depth=1

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: ${{ env.PNPM_VERSION }}

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Download package artifacts
uses: actions/download-artifact@v3

- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Setup Node.js and pnpm
uses: ./.github/actions/setup-node-pnpm

- name: Run Tests - Unit
run: |
Expand Down
101 changes: 0 additions & 101 deletions .github/workflows/ci.yml

This file was deleted.

25 changes: 25 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Release

on:
push:
branches:
- 'draft'
- 'main'

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

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

- name: Setup Node.js and pnpm
uses: ./.github/actions/setup-node-pnpm

- name: Create Release Pull Request
uses: changesets/action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62 changes: 62 additions & 0 deletions .github/workflows/storybook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Geist Dapp Kit

on:
pull_request:
branches:
- 'draft'
- 'main'
push:
branches:
- 'draft'
- 'main'
paths:
- 'apps/storybook/**'
- 'pnpm-*.yaml'

env:
TEST_EAS_PRIVATE_KEY: ${{ secrets.TEST_EAS_PRIVATE_KEY }}
TEST_USER_PRIVATE_KEY: ${{ secrets.TEST_USER_PRIVATE_KEY }}
LIGHTHOUSE_API_KEY: ${{ secrets.LIGHTHOUSE_API_KEY }}

jobs:
build-storybook:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js and pnpm
uses: ./.github/actions/setup-node-pnpm

- name: Build app
run: pnpm --filter storybook build

- name: Upload storybook build
uses: actions/upload-artifact@v4
with:
name: storybook-build
path: apps/storybook/storybook-static

# smoke test, disabled for now
# - name: Build gql
# run: pnpm --filter graphql build:gql

deploy-storybook:
needs: [build-storybook]
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Setup Node.js and pnpm
uses: ./.github/actions/setup-node-pnpm.yml

- name: Download storybook build
uses: actions/download-artifact@v4
with:
name: storybook-build
path: apps/storybook/storybook-static

- name: Deploy app
env:
FLEEK_TOKEN: ${{ secrets.FLEEK_TOKEN }}
FLEEK_PROJECT_ID: ${{ secrets.FLEEK_PROJECT_ID }}
run: pnpm --dir apps/storybook deploy:fleek
7 changes: 7 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,12 @@
- Refers to [/implementation_guide.md]


### Package Versioning

This project uses [changesets](https://github.com/changesets/changesets) for package versioning and publishing. When making changes:

1. Run `pnpm changeset` to create a new changeset
2. Follow the prompts to describe your changes
3. Commit the generated changeset file

For more details on using changesets, refer to the [official documentation](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md).
2 changes: 1 addition & 1 deletion apps/storybook/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "storybook",
"name": "@geist/storybook",
"private": true,
"version": "0.0.0",
"type": "module",
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"devDependencies": {
"@0no-co/graphqlsp": "^1.12.15",
"@biomejs/biome": "^1.9.4",
"@changesets/cli": "^2.27.11",
"@graphql-codegen/cli": "^5.0.2",
"@graphql-codegen/introspection": "^4.0.3",
"@graphql-codegen/schema-ast": "^4.1.0",
Expand All @@ -30,9 +31,9 @@
},
"engines": {
"node": ">=22",
"pnpm": ">=9"
"pnpm": ">=10"
},
"packageManager": "pnpm@9.7.0",
"packageManager": "pnpm@10.0.0+sha512.b8fef5494bd3fe4cbd4edabd0745df2ee5be3e4b0b8b08fa643aa3e4c6702ccc0f00d68fa8a8c9858a735a0032485a44990ed2810526c875e416f001b17df12b",
"dependencies": {
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.0.1",
Expand Down
Loading
Loading