Skip to content

Commit 2b75421

Browse files
Merge pull request #38 from boldare/chore/github-actions
docs: workflow for publishing new release versions
2 parents c41b78a + 45e77db commit 2b75421

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

.github/workflows/publish.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Publish package to GitHub Packages
2+
on:
3+
release:
4+
types: [published]
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
permissions:
9+
contents: read
10+
packages: write
11+
steps:
12+
- uses: actions/checkout@v4
13+
# Setup .npmrc file to publish to GitHub Packages
14+
- uses: actions/setup-node@v4
15+
with:
16+
node-version: '20.x'
17+
registry-url: 'https://npm.pkg.github.com'
18+
scope: '@boldare'
19+
- run: npm ci
20+
- run: npm publish
21+
env:
22+
NODE_AUTH_TOKEN: ${{ secrets.BOLDARE_GITHUB_TOKEN }}

libs/ai-assistant/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "@boldare/ai-assistant",
3-
"version": "0.0.2-dev.3",
3+
"version": "0.0.2-dev.5",
4+
"private": false,
45
"dependencies": {
56
"tslib": "^2.3.0",
67
"openai": "^4.26.1",

libs/ai-assistant/src/lib/assistant/assistant-memory.service.spec.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,18 @@ describe('AssistantMemoryService', () => {
4848
);
4949
});
5050

51+
it('should log error', async () => {
52+
const error = new Error('error');
53+
const sourcePath = './.env';
54+
const readFileSpy = jest
55+
.spyOn(fs.promises, 'readFile')
56+
.mockRejectedValue(error);
57+
const loggerSpy = jest.spyOn(assistantMemoryService['logger'], 'error');
58+
59+
await assistantMemoryService.saveAssistantId('456');
60+
61+
expect(readFileSpy).toHaveBeenCalledWith(sourcePath);
62+
expect(loggerSpy).toHaveBeenCalledWith(`Can't save variable: ${error}`);
63+
});
5164
});
5265
});

0 commit comments

Comments
 (0)