Skip to content
Merged
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
26 changes: 20 additions & 6 deletions .github/workflows/ui_release_aap_chatbot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ jobs:
WORKING_DIRECTORY: ./aap_chatbot

steps:
- name: Checkout commit
- name: Checkout
uses: actions/checkout@v4
with:
ref: refs/heads/main

- name: Use Node.js
uses: actions/setup-node@v4
Expand All @@ -30,14 +32,26 @@ jobs:
run: npm run test
working-directory: ${{env.WORKING_DIRECTORY}}

- name: Run linter
run: npm run eslint
working-directory: ${{env.WORKING_DIRECTORY}}

- name: Versioning
# Consider patch/minor/major versions later on, maybe as a workflow input.
run: npm version patch
working-directory: ${{env.WORKING_DIRECTORY}}

- uses: EndBug/add-and-commit@v9
- name: Create Pull Request
id: create_pr
uses: peter-evans/create-pull-request@v6
with:
cwd: ${{env.WORKING_DIRECTORY}}
add: 'package.json package-lock.json'
message: 'Upgrading the AAP Chatbot UI module version.'
push: true
commit-message: "New AAP Chatbot UI package release."
committer: GitHub <noreply@github.com>
author: GitHub <noreply@github.com>
branch: aap-chatbot-release
delete-branch: true
title: "[Automated PR] Release the AAP Chatbot UI package."
body: "Release the AAP Chatbot UI package."
add-paths: |
aap_chatbot/package.json
aap_chatbot/package-lock.json
13 changes: 13 additions & 0 deletions aap_chatbot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,16 @@ CHATBOT_DEFAULT_PROVIDER=wisdom
}
}
```

## Releasing and publishing

Run the following GH workflows, in order:

1.- [AAP Chatbot - Release](../.github/workflows/ui_release_aap_chatbot.yml)
It validates the package by running tests, if successful, creates a new Pull Request with the package information.

2.- [AAP Chatbot - Publish](../.github/workflows/ui_publish_aap_chatbot.yml)
Should be run just after releasing. It validates the package by running tests, if successful, it builds, assembles and publishes the new [package version into npmjs](https://www.npmjs.com/package/@ansible/ansible-ai-connect-chatbot?activeTab=versions).

NOTE: Split the whole process into two different workflows so it gives a bit more flexibility on how to release and when to publish.
NOTE: Based on the [npmjs guideline for publishing new packages](https://docs.npmjs.com/updating-your-published-package-version-number).
1 change: 1 addition & 0 deletions aap_chatbot/src/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ function mockFetchEventSource() {
const ok = status === 200;
await init.onopen({ status, ok });
if (status === 200) {
// eslint-disable-next-line no-nested-ternary
const streamData = agent
? streamAgentNormalData
: errorCase
Expand Down