diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index abb66cf8e0..b2fb902a50 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -42,36 +42,49 @@ jobs: echo "::set-output name=is_in_prerelease_mode::false" fi - - name: Create Release Pull Request or Publish to npm - id: changesets - uses: ./.github/actions/changesets-action - with: - publish: pnpm changeset publish --no-git-tag - cwd: CopilotKit - createGithubReleases: true + - name: Get current version + id: current-version + run: | + echo "version=$(node -p "require('./packages/react-core/package.json').version")" >> "$GITHUB_OUTPUT" + + - name: Make prerelease + if: ${{ steps.is-in-prerelease-mode.outputs.is_in_prerelease_mode == 'true' }} + id: prerelease + run: | + pnpm changeset version + pnpm changeset publish --no-git-tag --tag next env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }} OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - - name: Print outputs + - name: Get new version + id: new-version run: | - echo "published: ${{ steps.changesets.outputs.published }}" - echo "publishedPackages: ${{ steps.changesets.outputs.publishedPackages }}" + echo "version=$(node -p "require('./packages/react-core/package.json').version")" >> "$GITHUB_OUTPUT" + + - name: Check if published + id: check-if-published + run: | + if [ "${{ steps.new-version.outputs.version }}" != "${{ steps.current-version.outputs.version }}" ]; then + echo "::set-output name=published::true" + else + echo "::set-output name=published::false" + fi - name: Tag "next" post publish - if: ${{ steps.changesets.outputs.published == 'true' }} && ${{ steps.is-in-prerelease-mode.outputs.is_in_prerelease_mode == 'true' }} + if: ${{ steps.check-if-published.outputs.published == 'true' }} && ${{ steps.is-in-prerelease-mode.outputs.is_in_prerelease_mode == 'true' }} run: | echo "Will tag next" - name: Put `main` back in prerelease mode - if: ${{ github.ref == 'refs/heads/main' && steps.changesets.outputs.published }} + if: ${{ github.ref == 'refs/heads/main' && steps.check-if-published.outputs.published == 'true' }} run: | - if [ ! -f ".changeset/pre.json" ]; then - pnpm changeset pre enter next - git config --global user.email "github-actions[bot]@users.noreply.github.com" - git config --global user.name "github-actions[bot]" - git add . + if [ ! -f ".changeset/pre.json" ]; then + pnpm changeset pre enter next + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git config --global user.name "github-actions[bot]" + git add . git commit -m "chore: entering prerelease mode (next)" git push origin main --force fi diff --git a/CopilotKit/.changeset/dull-clouds-sell.md b/CopilotKit/.changeset/dull-clouds-sell.md new file mode 100644 index 0000000000..6d24100405 --- /dev/null +++ b/CopilotKit/.changeset/dull-clouds-sell.md @@ -0,0 +1,11 @@ +--- +"@copilotkit/react-core": patch +"@copilotkit/react-textarea": patch +"@copilotkit/react-ui": patch +"@copilotkit/runtime": patch +"@copilotkit/runtime-client-gql": patch +"@copilotkit/sdk-js": patch +"@copilotkit/shared": patch +--- + +test prerelease #4 diff --git a/CopilotKit/package.json b/CopilotKit/package.json index d48957f0a2..12b8c0216e 100644 --- a/CopilotKit/package.json +++ b/CopilotKit/package.json @@ -10,9 +10,9 @@ "check-types": "turbo check-types", "format": "prettier --write \"**/*.{ts,tsx,md}\"", "check-prettier": "prettier --check \"**/*.{ts,tsx,md}\"", - "publish-packages": "turbo run build lint && changeset version && changeset publish", "freshbuild": "pnpm -w clean && pnpm i && pnpm -w build", - "precommit": "pnpm run docs" + "precommit": "pnpm run docs", + "prepublish": "turbo run build" }, "devDependencies": { "@changesets/cli": "^2.27.10",