From c6d3b3df8ed9c80df49fbc8f7080acfeda03388c Mon Sep 17 00:00:00 2001 From: Phil Pluckthun Date: Tue, 21 Nov 2023 13:18:01 +0000 Subject: [PATCH] Add tasks --- .changeset/README.md | 8 ++++ .changeset/config.json | 16 ++++++++ .github/workflows/ci.yml | 27 +++++++------ .github/workflows/release.yml | 71 +++++++++++++++++++++++++++++++++++ package.json | 4 +- 5 files changed, 113 insertions(+), 13 deletions(-) create mode 100644 .changeset/README.md create mode 100644 .changeset/config.json create mode 100644 .github/workflows/release.yml diff --git a/.changeset/README.md b/.changeset/README.md new file mode 100644 index 00000000..4f3b76b0 --- /dev/null +++ b/.changeset/README.md @@ -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) diff --git a/.changeset/config.json b/.changeset/config.json new file mode 100644 index 00000000..28d6c3c4 --- /dev/null +++ b/.changeset/config.json @@ -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" + } +} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index abf53139..36d2522e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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- @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..194c4ad4 --- /dev/null +++ b/.github/workflows/release.yml @@ -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 diff --git a/package.json b/package.json index f1be54aa..eb495e0e 100644 --- a/package.json +++ b/package.json @@ -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": {