Skip to content

Commit

Permalink
chore(ci): update next to contain main ci
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusmarminge committed Aug 15, 2022
1 parent d9fff96 commit 60f7bf8
Show file tree
Hide file tree
Showing 19 changed files with 927 additions and 59 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": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
22 changes: 0 additions & 22 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: 🐞 Bug Report
description: Create a bug report to help us improve
title: "bug: "
labels: ["unconfirmed bug"]
body:
- type: textarea
attributes:
label: Provide environment information
description: |
Run this command in your project root and paste the results:
```bash
npx envinfo --system --binaries
```
If the issue is regarding a scaffolded app, please include the version used to scaffold that app which you can find in the `package.json` under `ct3aMetadata.initVersion`.
validations:
required: true
- type: textarea
attributes:
label: Describe the bug
description: A clear and consice description of the bug, as well as what you expected to happen when encountering it.
validations:
required: true
- type: textarea
attributes:
label: To reproduce
description: Describe how to reproduce your bug. Steps, code snippets, reproduction repos etc.
validations:
required: true
- type: textarea
attributes:
label: Additional information
description: Add any other information related to the bug here, screenshots if applicable.
16 changes: 0 additions & 16 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: 🧑‍💻 Feature Request
description: Suggest an idea for this project
title: "feat: "
labels: ["enhancement"]
body:
- type: textarea
attributes:
label: Is your feature request related to a problem? Please describe.
description: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
validations:
required: true
- type: textarea
attributes:
label: Describe the solution you'd like to see
description: A clear and concise description of what you want to happen.
validations:
required: true
- type: textarea
attributes:
label: Desribe alternate solutions
description: A clear and concise description of any alternative solutions or features you've considered.
validations:
required: true
- type: textarea
attributes:
label: Additional information
description: Add any other information related to the feature here. If your feature request is related to any issues or discussions, link them here.
11 changes: 11 additions & 0 deletions .github/changeset-version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// ORIGINALLY FROM CLOUDFLARE WRANGLER:
// https://github.com/cloudflare/wrangler2/blob/main/.github/changeset-version.js

import { exec } from "child_process";
// This script is used by the `release.yml` workflow to update the version of the packages being released.
// The standard step is only to run `changeset version` but this does not update the package-lock.json file.
// So we also run `npm install`, which does this update.
// This is a workaround until this is handled automatically by `changeset version`.
// See https://github.com/changesets/changesets/issues/421.
exec("npx changeset version");
exec("npm install");
5 changes: 5 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"area: cli":
- any: ["src/**"]

"area: t3-app":
- any: ["template/**"]
10 changes: 7 additions & 3 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# [Short title]
Closes #<issue>

- [ ] I reviewed linter warnings + errors, resolved formatting, types and other issues related to my work
## ✅ Checklist

- [ ] I have followed every step in the [contributing guide](https://github.com/t3-oss/create-t3-app/blob/main/CONTRIBUTING.md) (updated 2022-08-15).
- [ ] The PR title follows the convention we established [conventional-commit](https://www.conventionalcommits.org/en/v1.0.0/)
- [ ] I performed a functional test on my final commit

---

_[Short summary/description of story/feature/bugfix]_
## Changelog

_[Short description of what has changed]_

---

Expand Down
19 changes: 19 additions & 0 deletions .github/version-script-beta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// ORIGINALLY FROM CLOUDFLARE WRANGLER:
// https://github.com/cloudflare/wrangler2/blob/main/.github/version-script.js
import fs from "fs";
import { exec } from "child_process";

try {
const pkg = JSON.parse(fs.readFileSync("package.json"));
exec("git rev-parse --short HEAD", (err, stdout) => {
if (err) {
console.log(err);
process.exit(1);
}
pkg.version = "6.0.0-beta." + stdout.trim();
fs.writeFileSync("package.json", JSON.stringify(pkg, null, "\t") + "\n");
});
} catch (error) {
console.error(error);
process.exit(1);
}
19 changes: 19 additions & 0 deletions .github/version-script-next.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// ORIGINALLY FROM CLOUDFLARE WRANGLER:
// https://github.com/cloudflare/wrangler2/blob/main/.github/version-script.js
import fs from "fs";
import { exec } from "child_process";

try {
const pkg = JSON.parse(fs.readFileSync("package.json"));
exec("git rev-parse --short HEAD", (err, stdout) => {
if (err) {
console.log(err);
process.exit(1);
}
pkg.version = "6.0.0-next." + stdout.trim();
fs.writeFileSync("package.json", JSON.stringify(pkg, null, "\t") + "\n");
});
} catch (error) {
console.error(error);
process.exit(1);
}
2 changes: 1 addition & 1 deletion .github/workflows/PR-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 16
- run: pnpm lint:check
- run: pnpm lint

lint-pr:
runs-on: ubuntu-latest
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/nextrelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Originally inspired by Cloudflare Wrangler
# https://github.com/cloudflare/wrangler2/blob/main/.github/workflows/prereleases.yml

name: Prerelease

on:
push:
branches:
- next
jobs:
prerelease:
if: ${{ github.repository_owner == 't3-oss' }}
name: Build & Publish a next release to NPM
runs-on: ubuntu-latest

steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Use PNPM
uses: pnpm/[email protected]
with:
version: 7.2.1

- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16
cache: "pnpm"

- name: Install NPM Dependencies
run: pnpm install

- name: Modify package.json version
run: node .github/version-script-next.js

- name: Authenticate to NPM
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_ACCESS_TOKEN }}" > .npmrc

- name: Publish Beta to NPM
run: pnpm pub:next
env:
NPM_PUBLISH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
14 changes: 14 additions & 0 deletions .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: "Pull Request Labeler"
on:
- pull_request_target

jobs:
triage:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
45 changes: 45 additions & 0 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Originally inspired by Cloudflare Wrangler
# https://github.com/cloudflare/wrangler2/blob/main/.github/workflows/prereleases.yml

name: Prerelease

on:
push:
branches:
- main
jobs:
prerelease:
if: ${{ github.repository_owner == 't3-oss' }}
name: Build & Publish a beta release to NPM
runs-on: ubuntu-latest

steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Use PNPM
uses: pnpm/[email protected]
with:
version: 7.2.1

- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16
cache: "pnpm"

- name: Install NPM Dependencies
run: pnpm install

- name: Modify package.json version
run: node .github/version-script-beta.js

- name: Authenticate to NPM
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_ACCESS_TOKEN }}" > .npmrc

- name: Publish Beta to NPM
run: pnpm pub:beta
env:
NPM_PUBLISH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
53 changes: 53 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Originally inspired by Cloudflare Wrangler
# https://github.com/cloudflare/wrangler2/blob/main/.github/workflows/release.yml

name: Release

on:
push:
branches:
- main

jobs:
release:
if: ${{ github.repository_owner == 't3-oss' }}
name: Create a PR for release workflow
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Use PNPM
uses: pnpm/[email protected]
with:
version: 7.2.1

- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16
cache: "pnpm"

- name: Install NPM Dependencies
run: pnpm install

- name: Check for errors
run: pnpm check

- name: Build the package
run: pnpm build

- name: Create Version PR or Publish to NPM
id: changesets
uses: changesets/action@v1
with:
commit: "chore(release): version packages"
title: "chore(release): version packages"
version: node .github/changeset-version.js
publish: npx changeset publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
NODE_ENV: "production"
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
## 5.7.0

### Minor Changes

- 7a76c95: feat(app): add lint config for typescript

## [5.6.0](https://github.com/t3-oss/create-t3-app/compare/v5.5.0...v5.6.0) (2022-08-11)

Expand Down
Loading

0 comments on commit 60f7bf8

Please sign in to comment.