forked from t3-oss/create-t3-app
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cb61f26
commit e5e3fca
Showing
5 changed files
with
76 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// ORIGINALLY FROM CLOUDFLARE WRANGLER: | ||
// https://github.com/cloudflare/wrangler2/blob/main/.github/version-script.js | ||
import fs from "fs"; | ||
import { exec } from "child_process"; | ||
import { getT3Version } from "../src/utils/getT3Version"; | ||
|
||
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); | ||
} | ||
const currentVersion = getT3Version(); | ||
pkg.version = currentVersion + "-next." + stdout.trim(); | ||
fs.writeFileSync("package.json", JSON.stringify(pkg, null, "\t") + "\n"); | ||
}); | ||
} catch (error) { | ||
console.error(error); | ||
process.exit(1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/action-setup@v2.2.2 | ||
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters