Skip to content

Commit 1fcc91a

Browse files
committed
Trying a release out
1 parent cdae714 commit 1fcc91a

File tree

3 files changed

+78
-1
lines changed

3 files changed

+78
-1
lines changed

.github/workflows/ci.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: ci
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: override release tag
8+
required: false
9+
push:
10+
branches: [main, alpha, beta]
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
14+
cancel-in-progress: true
15+
16+
permissions:
17+
contents: write
18+
id-token: write
19+
20+
jobs:
21+
test-and-publish:
22+
name: Test & Publish
23+
if: github.repository_owner == 'TanStack'
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout
27+
uses: actions/[email protected]
28+
with:
29+
fetch-depth: 0
30+
- name: Setup Tools
31+
uses: tanstack/config/.github/setup@main
32+
- name: Build
33+
run: pnpm build
34+
- name: Publish
35+
run: |
36+
git config --global user.name 'Tanner Linsley'
37+
git config --global user.email '[email protected]'
38+
npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
39+
pnpm run cipublish
40+
env:
41+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
43+
TAG: ${{ inputs.tag }}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"scripts": {
88
"build": "tsc",
99
"start": "tsc && node dist/index.js",
10-
"test": "echo \"Error: no test specified\" && exit 1",
10+
"test": "echo \"Error: no test specified\" && exit 0",
11+
"cipublish": "node scripts/publish.js",
1112
"test:lint": "eslint ./src"
1213
},
1314
"keywords": [

scripts/publish.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// @ts-check
2+
3+
import { resolve } from 'node:path'
4+
import { fileURLToPath } from 'node:url'
5+
import { publish } from '@tanstack/config/publish'
6+
7+
const __dirname = fileURLToPath(new URL('.', import.meta.url))
8+
9+
await publish({
10+
packages: [
11+
{
12+
name: 'create-tanstack-app',
13+
packageDir: '.',
14+
},
15+
],
16+
branchConfigs: {
17+
main: {
18+
prerelease: false,
19+
},
20+
alpha: {
21+
prerelease: true,
22+
},
23+
beta: {
24+
prerelease: true,
25+
},
26+
},
27+
rootDir: resolve(__dirname, '..'),
28+
branch: process.env.BRANCH,
29+
tag: process.env.TAG,
30+
ghToken: process.env.GH_TOKEN,
31+
})
32+
33+
process.exit(0)

0 commit comments

Comments
 (0)