From 12be48d129a1f539530e9bafe77f0f03d302f804 Mon Sep 17 00:00:00 2001 From: Jocelyn Lin Date: Wed, 4 Mar 2026 16:07:16 -0800 Subject: [PATCH 1/4] feat(workflow): add GitHub Actions workflow for publishing @flowiseai/agentflow - Introduced a new workflow to handle version bumps and publishing of the @flowiseai/agentflow package. - Supports various version bump types (prerelease, patch, minor, major, custom) and allows for custom version input. - Includes a dry-run step to validate the version and simulate the publish process before actual deployment. - Configured to use pnpm for dependency management and publishing tasks. --- .github/workflows/publish-agentflow.yml | 121 ++++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 .github/workflows/publish-agentflow.yml diff --git a/.github/workflows/publish-agentflow.yml b/.github/workflows/publish-agentflow.yml new file mode 100644 index 00000000000..83eb0ce7b29 --- /dev/null +++ b/.github/workflows/publish-agentflow.yml @@ -0,0 +1,121 @@ +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' + required: false + type: choice + default: 'dev' + options: + - dev + - latest + +jobs: + dry-run: + runs-on: ubuntu-latest + permissions: + contents: read + outputs: + version: ${{ steps.resolve-version.outputs.version }} + steps: + - uses: actions/checkout@v4 + + - uses: pnpm/action-setup@v2 + + - uses: actions/setup-node@v4 + with: + node-version: '18.15.0' + registry-url: 'https://registry.npmjs.org' + + - name: Validate custom version + if: inputs.bump == 'custom' + run: | + if [ -z "${{ inputs.custom_version }}" ]; then + echo "::error::custom_version is required when bump is 'custom'" + exit 1 + fi + npx semver "${{ inputs.custom_version }}" || (echo "::error::Invalid semver: ${{ inputs.custom_version }}" && exit 1) + + - name: Install dependencies + run: pnpm install --frozen-lockfile + env: + PUPPETEER_SKIP_DOWNLOAD: 'true' + + - name: Set version + run: | + if [ "${{ inputs.bump }}" = "custom" ]; then + pnpm --filter @flowiseai/agentflow exec npm version "${{ inputs.custom_version }}" --no-git-tag-version + else + pnpm --filter @flowiseai/agentflow exec npm version "${{ inputs.bump }}" --preid dev --no-git-tag-version + fi + + - name: Resolve version + id: resolve-version + run: | + VERSION=$(node -p "require('./packages/agentflow/package.json').version") + 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 exec npm 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: read + steps: + - uses: actions/checkout@v4 + + - uses: pnpm/action-setup@v2 + + - uses: actions/setup-node@v4 + with: + node-version: '18.15.0' + registry-url: 'https://registry.npmjs.org' + + - name: Install dependencies + run: pnpm install --frozen-lockfile + env: + PUPPETEER_SKIP_DOWNLOAD: 'true' + + - name: Set version + run: | + if [ "${{ inputs.bump }}" = "custom" ]; then + pnpm --filter @flowiseai/agentflow exec npm version "${{ inputs.custom_version }}" --no-git-tag-version + else + pnpm --filter @flowiseai/agentflow exec npm version "${{ inputs.bump }}" --preid dev --no-git-tag-version + fi + + - 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 }} From c9f043f490694e69cce59d05327527d94d363d29 Mon Sep 17 00:00:00 2001 From: Jocelyn Lin Date: Wed, 4 Mar 2026 16:35:57 -0800 Subject: [PATCH 2/4] chore(workflow): update permissions and add version bump commit step - Changed permissions for the GitHub Actions workflow to allow write access for contents. - Added a step to commit and push the version bump for the @flowiseai/agentflow package after publishing. --- .github/workflows/publish-agentflow.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-agentflow.yml b/.github/workflows/publish-agentflow.yml index 83eb0ce7b29..e4166d86299 100644 --- a/.github/workflows/publish-agentflow.yml +++ b/.github/workflows/publish-agentflow.yml @@ -86,7 +86,7 @@ jobs: runs-on: ubuntu-latest environment: npm-publish permissions: - contents: read + contents: write steps: - uses: actions/checkout@v4 @@ -119,3 +119,11 @@ jobs: run: pnpm --filter @flowiseai/agentflow publish --no-git-checks --tag ${{ inputs.tag }} env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + - name: Commit version bump + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add packages/agentflow/package.json + git commit -m "chore: bump @flowiseai/agentflow to ${{ needs.dry-run.outputs.version }}" + git push From af96a12df7c508003ad13b9fd5519be0eaf720af Mon Sep 17 00:00:00 2001 From: Jocelyn Lin Date: Wed, 4 Mar 2026 16:56:47 -0800 Subject: [PATCH 3/4] chore(workflow): enhance version bump process with PR creation - Added permission for pull-requests in the GitHub Actions workflow. - Modified the version bump step to create a new branch and open a pull request after committing the version bump for the @flowiseai/agentflow package. --- .github/workflows/publish-agentflow.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-agentflow.yml b/.github/workflows/publish-agentflow.yml index e4166d86299..4d5b7d1ed2e 100644 --- a/.github/workflows/publish-agentflow.yml +++ b/.github/workflows/publish-agentflow.yml @@ -87,6 +87,7 @@ jobs: environment: npm-publish permissions: contents: write + pull-requests: write steps: - uses: actions/checkout@v4 @@ -120,10 +121,20 @@ jobs: env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - name: Commit version bump + - 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 ${{ needs.dry-run.outputs.version }}" - git push + 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 }} From 1f7d6af4b1b2f3acd002d3e29f7e9244bc3f19a6 Mon Sep 17 00:00:00 2001 From: Jocelyn Lin Date: Wed, 4 Mar 2026 17:02:15 -0800 Subject: [PATCH 4/4] address review comments --- .github/workflows/publish-agentflow.yml | 28 ++++++++++++++++++------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish-agentflow.yml b/.github/workflows/publish-agentflow.yml index 4d5b7d1ed2e..829e49dce93 100644 --- a/.github/workflows/publish-agentflow.yml +++ b/.github/workflows/publish-agentflow.yml @@ -37,6 +37,8 @@ jobs: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v2 + with: + version: 10.26.0 - uses: actions/setup-node@v4 with: @@ -46,11 +48,13 @@ jobs: - name: Validate custom version if: inputs.bump == 'custom' run: | - if [ -z "${{ inputs.custom_version }}" ]; then + if [ -z "$CUSTOM_VERSION" ]; then echo "::error::custom_version is required when bump is 'custom'" exit 1 fi - npx semver "${{ inputs.custom_version }}" || (echo "::error::Invalid semver: ${{ inputs.custom_version }}" && exit 1) + 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 @@ -59,11 +63,14 @@ jobs: - name: Set version run: | - if [ "${{ inputs.bump }}" = "custom" ]; then - pnpm --filter @flowiseai/agentflow exec npm version "${{ inputs.custom_version }}" --no-git-tag-version + if [ "$BUMP" = "custom" ]; then + pnpm --filter @flowiseai/agentflow exec npm version "$CUSTOM_VERSION" --no-git-tag-version else - pnpm --filter @flowiseai/agentflow exec npm version "${{ inputs.bump }}" --preid dev --no-git-tag-version + pnpm --filter @flowiseai/agentflow exec npm version "$BUMP" --preid dev --no-git-tag-version fi + env: + BUMP: ${{ inputs.bump }} + CUSTOM_VERSION: ${{ inputs.custom_version }} - name: Resolve version id: resolve-version @@ -92,6 +99,8 @@ jobs: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v2 + with: + version: 10.26.0 - uses: actions/setup-node@v4 with: @@ -105,11 +114,14 @@ jobs: - name: Set version run: | - if [ "${{ inputs.bump }}" = "custom" ]; then - pnpm --filter @flowiseai/agentflow exec npm version "${{ inputs.custom_version }}" --no-git-tag-version + if [ "$BUMP" = "custom" ]; then + pnpm --filter @flowiseai/agentflow exec npm version "$CUSTOM_VERSION" --no-git-tag-version else - pnpm --filter @flowiseai/agentflow exec npm version "${{ inputs.bump }}" --preid dev --no-git-tag-version + pnpm --filter @flowiseai/agentflow exec npm version "$BUMP" --preid dev --no-git-tag-version fi + env: + BUMP: ${{ inputs.bump }} + CUSTOM_VERSION: ${{ inputs.custom_version }} - name: Log version run: |