mirror of
https://github.com/FlowiseAI/Flowise.git
synced 2026-10-12 02:02:17 +00:00
* chore: update agentflow workflow and add changelog - Enhanced the npm dist-tag description in the publish-agentflow.yml workflow to clarify options for development, pre-release, and stable versions. - Introduced a new CHANGELOG.md file for the @flowiseai/agentflow package, documenting notable changes and adhering to the Keep a Changelog format. - Updated README.md to reflect the current development status and features of the agentflow package, including detailed descriptions of functionalities and examples. * update TESTS.md to include TipTap mock
160 lines
5.9 KiB
YAML
160 lines
5.9 KiB
YAML
name: Publish @flowiseai/agentflow
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
bump:
|
|
description: 'Version bump type'
|
|
required: true
|
|
type: choice
|
|
default: 'prerelease'
|
|
options:
|
|
- prerelease
|
|
- patch
|
|
- minor
|
|
- major
|
|
- custom
|
|
custom_version:
|
|
description: 'Custom version (only used when bump is "custom", e.g. 1.0.0-beta.1)'
|
|
required: false
|
|
type: string
|
|
tag:
|
|
description: 'npm dist-tag (dev = internal, next = pre-release, latest = stable)'
|
|
required: false
|
|
type: choice
|
|
default: 'dev'
|
|
options:
|
|
- dev
|
|
- next
|
|
- latest
|
|
|
|
jobs:
|
|
dry-run:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
outputs:
|
|
version: ${{ steps.resolve-version.outputs.version }}
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 10.26.0
|
|
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version: '20.20.2'
|
|
registry-url: 'https://registry.npmjs.org'
|
|
|
|
- name: Validate custom version
|
|
if: inputs.bump == 'custom'
|
|
run: |
|
|
if [ -z "$CUSTOM_VERSION" ]; then
|
|
echo "::error::custom_version is required when bump is 'custom'"
|
|
exit 1
|
|
fi
|
|
npx semver "$CUSTOM_VERSION" || (echo "::error::Invalid semver: $CUSTOM_VERSION" && exit 1)
|
|
env:
|
|
CUSTOM_VERSION: ${{ inputs.custom_version }}
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
env:
|
|
PUPPETEER_SKIP_DOWNLOAD: 'true'
|
|
|
|
- name: Set version
|
|
run: |
|
|
CURRENT=$(npm pkg get version --prefix packages/agentflow | tr -d '"')
|
|
if [ "$BUMP" = "custom" ]; then
|
|
NEW_VERSION="$CUSTOM_VERSION"
|
|
else
|
|
NEW_VERSION=$(npx semver "$CURRENT" -i "$BUMP" --preid dev)
|
|
fi
|
|
npm pkg set version="$NEW_VERSION" --prefix packages/agentflow
|
|
echo "Version set to $NEW_VERSION"
|
|
env:
|
|
BUMP: ${{ inputs.bump }}
|
|
CUSTOM_VERSION: ${{ inputs.custom_version }}
|
|
|
|
- name: Resolve version
|
|
id: resolve-version
|
|
run: |
|
|
VERSION=$(npm pkg get version --prefix packages/agentflow | tr -d '"')
|
|
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
|
echo "## Version to publish: \`$VERSION\`" >> "$GITHUB_STEP_SUMMARY"
|
|
echo "## Tag: \`${{ inputs.tag }}\`" >> "$GITHUB_STEP_SUMMARY"
|
|
|
|
- name: Package contents
|
|
run: pnpm --filter @flowiseai/agentflow pack --dry-run
|
|
|
|
- name: Dry run publish
|
|
run: pnpm --filter @flowiseai/agentflow publish --no-git-checks --dry-run --tag ${{ inputs.tag }}
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
|
|
publish:
|
|
needs: dry-run
|
|
runs-on: ubuntu-latest
|
|
environment: npm-publish
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 10.26.0
|
|
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version: '20.20.2'
|
|
registry-url: 'https://registry.npmjs.org'
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
env:
|
|
PUPPETEER_SKIP_DOWNLOAD: 'true'
|
|
|
|
- name: Set version
|
|
run: |
|
|
CURRENT=$(npm pkg get version --prefix packages/agentflow | tr -d '"')
|
|
if [ "$BUMP" = "custom" ]; then
|
|
NEW_VERSION="$CUSTOM_VERSION"
|
|
else
|
|
NEW_VERSION=$(npx semver "$CURRENT" -i "$BUMP" --preid dev)
|
|
fi
|
|
npm pkg set version="$NEW_VERSION" --prefix packages/agentflow
|
|
echo "Version set to $NEW_VERSION"
|
|
env:
|
|
BUMP: ${{ inputs.bump }}
|
|
CUSTOM_VERSION: ${{ inputs.custom_version }}
|
|
|
|
- name: Log version
|
|
run: |
|
|
echo "Publishing version: ${{ needs.dry-run.outputs.version }}"
|
|
echo "Tag: ${{ inputs.tag }}"
|
|
|
|
- name: Publish
|
|
run: pnpm --filter @flowiseai/agentflow publish --no-git-checks --tag ${{ inputs.tag }}
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
|
|
- name: Create version bump PR
|
|
run: |
|
|
VERSION="${{ needs.dry-run.outputs.version }}"
|
|
BRANCH="chore/bump-agentflow-${VERSION}"
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
git checkout -b "$BRANCH"
|
|
git add packages/agentflow/package.json
|
|
git commit -m "chore: bump @flowiseai/agentflow to ${VERSION}"
|
|
git push -u origin "$BRANCH"
|
|
gh pr create \
|
|
--title "chore: bump @flowiseai/agentflow to ${VERSION}" \
|
|
--body "Automated version bump after publishing \`@flowiseai/agentflow@${VERSION}\` to npm with tag \`${{ inputs.tag }}\`." \
|
|
--base main \
|
|
--head "$BRANCH"
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|