Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.1.2/schema.json",
"$schema": "https://unpkg.com/@changesets/config@4.0.0/schema.json",
"changelog": [
"@changesets/changelog-github",
{ "repo": "TanStack/router", "disableThanks": true }
Expand Down
182 changes: 146 additions & 36 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,63 +2,173 @@ name: Release

on:
push:
branches: [main, '*-pre', '*-maint']
# we do not support '*-maint' branches at this time

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the -maint suffix?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think it was meant for "maintenance" branches, but i'm not entirely sure

branches: [main, '*-pre']

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
Comment thread
Sheraff marked this conversation as resolved.
SERVER_PRESET: 'node-server'

permissions:
contents: write
id-token: write
pull-requests: write
permissions: {}

jobs:
release:
name: Release
select-mode:
name: Select Mode
runs-on: ubuntu-latest
timeout-minutes: 20
outputs:
mode: ${{ steps.changesets.outputs.mode }}
publish-plan-artifact-id: ${{ steps.changesets.outputs.publish-plan-artifact-id }}
prerelease: ${{ steps.release-channel.outputs.prerelease }}
latest: ${{ steps.release-channel.outputs.latest }}
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: true # changesets/action pushes Release PR commits
- name: Setup Tools
uses: TanStack/config/.github/setup@e4b48f16568324f76f467aa4c2aac2f05db632c3 # main
- name: Run Build
run: pnpm run build:all
- name: Enter Pre-Release Mode
if: "contains(github.ref_name, '-pre') && !hashFiles('.changeset/pre.json')"
run: pnpm changeset pre enter pre
- name: Determine dist-tag
id: dist-tag
persist-credentials: false
- name: Setup pnpm
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
cache: false
- name: Setup Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: .nvmrc
package-manager-cache: false
- name: Root-only install
run: pnpm install --filter . --frozen-lockfile --ignore-scripts
- name: Determine Release Channel
id: release-channel
run: |
BRANCH="${GITHUB_REF_NAME}"
if [[ "$BRANCH" == *-pre ]]; then
if [[ "$GITHUB_REF_NAME" == *-pre ]]; then
echo "prerelease=true" >> "$GITHUB_OUTPUT"
elif [[ "$BRANCH" == *-maint ]]; then
echo "tag=maint" >> "$GITHUB_OUTPUT"
echo "latest=false" >> "$GITHUB_OUTPUT"
else
echo "prerelease=false" >> "$GITHUB_OUTPUT"
echo "latest=true" >> "$GITHUB_OUTPUT"
fi
- name: Create Release Pull Request or Publish
- name: Select Release Mode
id: changesets
uses: changesets/action@63a615b9cd06ba9a3e6d13796c7fbcb080a60a0b # v1.8.0
uses: changesets/action/select-mode@22ccf9aa43179fe9e27dc62e575971d28cce197c # v2.0.0

version:
name: Version
needs: select-mode
if: needs.select-mode.outputs.mode == 'version'
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
version: pnpm run changeset:version
publish: pnpm run changeset:publish ${{ steps.dist-tag.outputs.tag && format('--tag {0}', steps.dist-tag.outputs.tag) }}
title: 'ci: Version Packages'
commit: 'ci: changeset release'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_OPTIONS: --max-old-space-size=8192
fetch-depth: 0
persist-credentials: false
- name: Setup Tools
uses: TanStack/config/.github/setup@e4b48f16568324f76f467aa4c2aac2f05db632c3 # main
- name: Enter Pre-Release Mode
if: needs.select-mode.outputs.prerelease == 'true' && !hashFiles('.changeset/pre.json')
run: pnpm changeset pre enter pre
- name: Create or Update Release Pull Request
uses: changesets/action/version@22ccf9aa43179fe9e27dc62e575971d28cce197c # v2.0.0
with:
github-token: ${{ github.token }}
script: pnpm run changeset:version
pr-title: 'ci: Version Packages'
commit-message: 'ci: changeset release'

pack:
name: Pack
needs: select-mode
if: needs.select-mode.outputs.mode == 'publish'
runs-on: ubuntu-latest
timeout-minutes: 30
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
outputs:
pack-dir-artifact-id: ${{ steps.pack.outputs.pack-dir-artifact-id }}
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup Tools
uses: TanStack/config/.github/setup@e4b48f16568324f76f467aa4c2aac2f05db632c3 # main
- name: Run Build
run: pnpm run build:all
- name: Pack Packages
id: pack
uses: changesets/action/pack@22ccf9aa43179fe9e27dc62e575971d28cce197c # v2.0.0
with:
publish-plan-artifact-id: ${{ needs.select-mode.outputs.publish-plan-artifact-id }}

publish:
name: Publish to npm
needs: [select-mode, pack]
if: needs.select-mode.outputs.mode == 'publish'
runs-on: ubuntu-latest
environment: npm
timeout-minutes: 20
outputs:
published: ${{ steps.publish.outputs.published }}
published-packages: ${{ steps.publish.outputs.published-packages }}
permissions:
contents: read
id-token: write
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup pnpm
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
cache: false
- name: Setup Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: .nvmrc
package-manager-cache: false
- name: Root-only install
run: pnpm install --filter . --frozen-lockfile --ignore-scripts
- name: Publish Packed Packages
id: publish
uses: changesets/action/publish@22ccf9aa43179fe9e27dc62e575971d28cce197c # v2.0.0
with:
pack-dir-artifact-id: ${{ needs.pack.outputs.pack-dir-artifact-id }}
create-github-releases: false
push-git-tags: false

release:
name: Create GitHub Release
needs: [select-mode, publish]
if: needs.publish.outputs.published == 'true'
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: true # create-github-release pushes the aggregate release tag
- name: Setup Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 24
package-manager-cache: false
- name: Create GitHub Release
if: steps.changesets.outputs.published == 'true'
run: node scripts/create-github-release.mjs ${{ steps.dist-tag.outputs.prerelease == 'true' && '--prerelease' }} ${{ steps.dist-tag.outputs.latest == 'true' && '--latest' }}
run: node scripts/create-github-release.mjs ${{ needs.select-mode.outputs.prerelease == 'true' && '--prerelease' }} ${{ needs.select-mode.outputs.latest == 'true' && '--latest' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ github.token }}
GH_TOKEN: ${{ github.token }}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"format": "prettier --experimental-cli --ignore-unknown '**/*' --write",
"changeset": "changeset",
"changeset:publish": "changeset publish",
"changeset:version": "changeset version && node scripts/update-example-deps.mjs && pnpm install --lockfile-only --ignore-scripts --no-frozen-lockfile && pnpm format",
Comment thread
Sheraff marked this conversation as resolved.
"changeset:version": "changeset version && node scripts/update-example-deps.mjs && pnpm install --lockfile-only --ignore-scripts --no-frozen-lockfile",
"gpt-generate": "node gpt/generate.js",
"set-ts-version": "node scripts/set-ts-version.js",
"labeler-generate": "node scripts/generate-labeler-config.ts",
Expand All @@ -62,8 +62,8 @@
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.18.4",
"@changesets/changelog-github": "^0.7.0",
"@changesets/cli": "^2.30.0",
"@changesets/changelog-github": "^1.0.0",
"@changesets/cli": "^3.0.0",
"@eslint-react/eslint-plugin": "^1.26.2",
"@nx/devkit": "22.7.5",
"@playwright/test": "catalog:",
Expand Down
Loading
Loading