Skip to content

Commit ea43a84

Browse files
committed
fix: openapi
1 parent c886b43 commit ea43a84

2 files changed

Lines changed: 56 additions & 29 deletions

File tree

.github/workflows/deploy-openapi-assets-dev.yml

Lines changed: 55 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ on:
77
- "packages/openapi/**"
88

99
jobs:
10-
deploy-package:
10+
pack:
1111
runs-on: ubuntu-latest
1212
environment: production
1313
permissions:
14-
# needed to create/update releases and upload assets
15-
contents: write
16-
14+
contents: read
15+
outputs:
16+
version: ${{ steps.set-outputs.outputs.version }}
17+
packfile_name: ${{ steps.set-outputs.outputs.packfile_name }}
1718
steps:
1819
- name: Checkout
1920
uses: actions/checkout@v4
@@ -23,42 +24,68 @@ jobs:
2324
with:
2425
node-version: "20"
2526

26-
- id: pack
27-
name: Pack @docs/openapi
27+
- id: set-outputs
28+
name: Pack @docs/openapi and upload artifacts
2829
run: |
30+
set -euo pipefail
2931
cd packages/openapi
3032
31-
# Install, then create a packed tarball; capture version & filename
33+
echo "Working dir: $(pwd)"
34+
cat package.json
35+
3236
npm ci
37+
38+
# npm pack prints the filename; grab the last non-empty line
39+
PACKFILE=$(npm pack | sed -n '/./p' | tail -n1)
40+
echo "Packed file: $PACKFILE"
41+
42+
# create stable 'latest' name
43+
LATEST_NAME="openapi-latest.tgz"
44+
cp -f "$PACKFILE" "$LATEST_NAME"
45+
46+
# ensure files exist
47+
ls -la
48+
3349
VERSION=$(node -p "require('./package.json').version")
34-
PACKFILE=$(npm pack | tail -n1)
50+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
51+
echo "packfile_name=$PACKFILE" >> "$GITHUB_OUTPUT"
3552
36-
# export step outputs for later steps
37-
echo "version=$VERSION" >> $GITHUB_OUTPUT
38-
# NOTE: packfile_name is just the filename (e.g. openapi-1.2.3.tgz)
39-
echo "packfile_name=$PACKFILE" >> $GITHUB_OUTPUT
40-
# tarball is the absolute path to the produced file
41-
echo "tarball=$PWD/$PACKFILE" >> $GITHUB_OUTPUT
53+
- name: Upload tarballs as artifact
54+
uses: actions/upload-artifact@v4
55+
with:
56+
name: openapi-tarballs
57+
path: |
58+
packages/openapi/${{ steps.set-outputs.outputs.packfile_name }}
59+
packages/openapi/openapi-latest.tgz
4260
43-
- name: Create or update tagged release and upload tarball
44-
id: gh_release_tag
45-
uses: softprops/action-gh-release@v1
61+
release_tag:
62+
runs-on: ubuntu-latest
63+
needs: pack
64+
environment: production
65+
permissions:
66+
contents: write
67+
steps:
68+
- name: Checkout (needed for workspace)
69+
uses: actions/checkout@v4
70+
71+
- name: Download packed artifacts
72+
uses: actions/download-artifact@v4
4673
with:
47-
tag_name: "openapi-v${{ steps.pack.outputs.version }}"
48-
name: "openapi v${{ steps.pack.outputs.version }}"
49-
body: "Automated release for packages/openapi (pack + upload)"
50-
files: ${{ steps.pack.outputs.tarball }}
51-
env:
52-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74+
name: openapi-tarballs
75+
path: artifacts
5376

54-
- name: Create or update latest release and upload tarball
55-
id: gh_release_latest
77+
- name: Show artifacts (debug)
78+
run: ls -la artifacts
79+
80+
- name: Create or update tagged release and upload versioned tarball
81+
id: gh_release_tag
5682
uses: softprops/action-gh-release@v1
5783
with:
58-
tag_name: "openapi-latest"
59-
name: "openapi latest"
84+
tag_name: "openapi-v${{ needs.pack.outputs.version }}"
85+
name: "openapi v${{ needs.pack.outputs.version }}"
6086
body: "Automated release for packages/openapi (pack + upload)"
61-
files: ${{ steps.pack.outputs.tarball }}
87+
# artifact downloads put files under ./artifacts/<filename>
88+
files: artifacts/${{ needs.pack.outputs.packfile_name }}
6289
env:
6390
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6491

packages/openapi/descriptions/assistant-thread.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default {
99
desc: `The object type.`,
1010
},
1111
role: {
12-
desc: `The role of the entity that is creating the Message.`,
12+
desc: `The role of the entity that is creating the Message`,
1313
},
1414
content: {
1515
text: {

0 commit comments

Comments
 (0)