Skip to content
Open
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
41 changes: 33 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,32 @@ jobs:
fi
fi

- name: Generate Flowise Publish Bot Token
id: app-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.FLOWISE_BOT_APP_ID }}
private-key: ${{ secrets.FLOWISE_BOT_PRIVATE_KEY }}
owner: FlowiseAI
repositories: |
FlowiseChatEmbed
FlowiseEmbedReact

- name: Checkout FlowiseChatEmbed
uses: actions/checkout@v6
with:
ref: main
fetch-depth: 1
path: flowise-embed
token: ${{ secrets.PAT_GITHUB }}
token: ${{ steps.app-token.outputs.token }}

- name: Checkout FlowiseEmbedReact
uses: actions/checkout@v6
with:
repository: FlowiseAI/FlowiseEmbedReact
fetch-depth: 1
path: flowise-embed-react
token: ${{ secrets.PAT_GITHUB }}
token: ${{ steps.app-token.outputs.token }}

- name: Setup Node.js
uses: actions/setup-node@v6
Expand Down Expand Up @@ -197,28 +208,40 @@ jobs:
# Runs only after a reviewer approves via the npm-publish environment gate.
# Publishes both packages to npm, then creates version bump PRs.
publish:
if: false
needs: dry-run
runs-on: ubuntu-latest
environment: npm-publish
permissions:
contents: write
pull-requests: write
steps:
- name: Generate Flowise Publish Bot Token
id: app-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.FLOWISE_BOT_APP_ID }}
private-key: ${{ secrets.FLOWISE_BOT_PRIVATE_KEY }}
owner: FlowiseAI
repositories: |
FlowiseChatEmbed
FlowiseEmbedReact

- name: Checkout FlowiseChatEmbed
uses: actions/checkout@v6
with:
ref: main
fetch-depth: 1
path: flowise-embed
token: ${{ secrets.PAT_GITHUB }}
token: ${{ steps.app-token.outputs.token }}

- name: Checkout FlowiseEmbedReact
uses: actions/checkout@v6
with:
repository: FlowiseAI/FlowiseEmbedReact
fetch-depth: 1
path: flowise-embed-react
token: ${{ secrets.PAT_GITHUB }}
token: ${{ steps.app-token.outputs.token }}

- name: Setup Node.js
uses: actions/setup-node@v6
Expand All @@ -227,9 +250,11 @@ jobs:
registry-url: 'https://registry.npmjs.org'

- name: Configure git
env:
APP_ID: ${{ secrets.FLOWISE_BOT_APP_ID }}
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "flowise-publish-bot[bot]"
git config --global user.email "${APP_ID}+flowise-publish-bot[bot]@users.noreply.github.com"

- name: Log publish intent
env:
Expand Down Expand Up @@ -291,7 +316,7 @@ jobs:
env:
VERSION: ${{ needs.dry-run.outputs.version }}
TAG: ${{ inputs.tag }}
GH_TOKEN: ${{ secrets.PAT_GITHUB }}
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
BRANCH="chore/bump-flowise-embed-${VERSION}"
if git ls-remote --exit-code --heads origin "$BRANCH" > /dev/null 2>&1; then
Expand Down Expand Up @@ -375,7 +400,7 @@ jobs:
env:
VERSION: ${{ needs.dry-run.outputs.version }}
TAG: ${{ inputs.tag }}
GH_TOKEN: ${{ secrets.PAT_GITHUB }}
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
BRANCH="chore/bump-flowise-embed-react-${VERSION}"
if git ls-remote --exit-code --heads origin "$BRANCH" > /dev/null 2>&1; then
Expand Down