Skip to content

Commit

Permalink
Add tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
kitten committed Nov 21, 2023
1 parent e61ffef commit c6d3b3d
Show file tree
Hide file tree
Showing 5 changed files with 113 additions and 13 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/master/docs/common-questions.md)
16 changes: 16 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://unpkg.com/@changesets/config@0.3.0/schema.json",
"changelog": "../scripts/changelog.js",
"commit": false,
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "minor",
"snapshot": {
"prereleaseTemplate": "{tag}-{commit}",
"useCalculatedVersion": true
},
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"onlyUpdatePeerDependentsWhenOutOfRange": true,
"updateInternalDependents": "out-of-range"
}
}
27 changes: 16 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,41 @@ name: CI

on:
pull_request:
branches:
- main
pull_request_review:
types: [submitted, edited]
branches: changeset-release/main

jobs:
test:
check:
name: Checks
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v1
with:
node-version: 18

- name: Setup pnpm
uses: pnpm/action-setup@v2.2.4
uses: pnpm/action-setup@v2.2.2
with:
version: 8
run_install: false

- name: Get pnpm store directory
id: pnpm-store
run: echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
run: echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"

- name: Use pnpm store
uses: actions/cache@v3
id: pnpm-cache
with:
path: |
~/.cache/Cypress
${{ steps.pnpm-store.outputs.pnpm_cache_dir }}
path: ${{ steps.pnpm-store.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
Expand All @@ -48,5 +47,11 @@ jobs:
- name: TypeScript
run: pnpm run check

- name: Linting
run: pnpm run lint

- name: Unit Tests
run: pnpm run test
run: pnpm run test --run

- name: Build
run: pnpm run build
71 changes: 71 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Release
on:
push:
branches:
- main
jobs:
release:
name: Release
runs-on: ubuntu-20.04
timeout-minutes: 20
permissions:
contents: write
id-token: write
issues: write
repository-projects: write
deployments: write
packages: write
pull-requests: write
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18

- name: Setup pnpm
uses: pnpm/action-setup@v2.2.2
with:
version: 8
run_install: false

- name: Get pnpm store directory
id: pnpm-store
run: echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"

- name: Use pnpm store
uses: actions/cache@v3
id: pnpm-cache
with:
path: ${{ steps.pnpm-store.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- name: Install Dependencies
run: pnpm install --frozen-lockfile --prefer-offline

- name: PR or Publish
id: changesets
uses: changesets/action@v1.4.5
with:
version: pnpm changeset:version
publish: pnpm changeset:publish
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish Prerelease
if: steps.changesets.outputs.published != 'true'
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm config set "//registry.npmjs.org/:_authToken" "$NPM_TOKEN"
git reset --hard origin/main
pnpm changeset version --no-git-tag --snapshot canary
pnpm changeset publish --no-git-tag --snapshot canary --tag canary
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
"changeset:version": "changeset version && pnpm install --lockfile-only",
"changeset:publish": "changeset publish"
},
"repository": "https://github.com/0no-co/graphql.ts",
"repository": "https://github.com/0no-co/gql.ts",
"bugs": {
"url": "https://github.com/0no-co/graphql.ts/issues"
"url": "https://github.com/0no-co/gql.ts/issues"
},
"license": "MIT",
"prettier": {
Expand Down

0 comments on commit c6d3b3d

Please sign in to comment.