From 15c4aa6d07fa7f5e7aaf02df1aada7a34b6c740f Mon Sep 17 00:00:00 2001 From: Daniil Bombenkov Date: Mon, 8 Dec 2025 18:24:49 +0300 Subject: [PATCH 1/2] feat: replace workflow --- .../workflows/deploy-openapi-assets-dev.yml | 136 ------------------ .github/workflows/deploy-openapi-assets.yml | 117 ++++++++++++++- 2 files changed, 115 insertions(+), 138 deletions(-) delete mode 100644 .github/workflows/deploy-openapi-assets-dev.yml diff --git a/.github/workflows/deploy-openapi-assets-dev.yml b/.github/workflows/deploy-openapi-assets-dev.yml deleted file mode 100644 index d99961f0..00000000 --- a/.github/workflows/deploy-openapi-assets-dev.yml +++ /dev/null @@ -1,136 +0,0 @@ -name: Deploy Openapi Assets - -on: - push: - branches: [feat-openapi-package] - paths: - - "packages/openapi/**" - -jobs: - pack: - runs-on: ubuntu-latest - environment: production - permissions: - contents: read - outputs: - version: ${{ steps.set-outputs.outputs.version }} - packfile_name: ${{ steps.set-outputs.outputs.packfile_name }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: "20" - - - id: set-outputs - name: Pack @docs/openapi and upload artifacts - run: | - set -euo pipefail - cd packages/openapi - - echo "Working dir: $(pwd)" - cat package.json - - npm ci - - # npm pack prints the filename; grab the last non-empty line - PACKFILE=$(npm pack | sed -n '/./p' | tail -n1) - echo "Packed file: $PACKFILE" - - # create stable 'latest' name - LATEST_NAME="openapi-latest.tgz" - cp -f "$PACKFILE" "$LATEST_NAME" - - # ensure files exist - ls -la - - VERSION=$(node -p "require('./package.json').version") - echo "version=$VERSION" >> "$GITHUB_OUTPUT" - echo "packfile_name=$PACKFILE" >> "$GITHUB_OUTPUT" - - - name: Upload tarballs as artifact - uses: actions/upload-artifact@v4 - with: - name: openapi-tarballs - path: | - packages/openapi/${{ steps.set-outputs.outputs.packfile_name }} - packages/openapi/openapi-latest.tgz - - release-openapi-packages: - runs-on: ubuntu-latest - needs: pack - environment: production - permissions: - contents: write - steps: - - name: Checkout (needed for workspace) - uses: actions/checkout@v4 - - - name: Download packed artifacts - uses: actions/download-artifact@v4 - with: - name: openapi-tarballs - path: artifacts - - - name: Show artifacts (debug) - run: ls -la artifacts || true - - - name: Resolve artifact paths - id: find - run: | - set -euo pipefail - PACKFILE="${{ needs.pack.outputs.packfile_name }}" - PACK_PATH=$(find artifacts -type f -name "$PACKFILE" -print -quit || true) - LATEST_PATH=$(find artifacts -type f -name "openapi-latest.tgz" -print -quit || true) - - echo "Found pack path: $PACK_PATH" - echo "Found latest path: $LATEST_PATH" - if [ -z "$PACK_PATH" ] || [ -z "$LATEST_PATH" ]; then - echo "::error::Missing artifact(s). Debug listing:" - ls -Rla artifacts || true - exit 1 - fi - - echo "pack_path=$PACK_PATH" >> "$GITHUB_OUTPUT" - echo "latest_path=$LATEST_PATH" >> "$GITHUB_OUTPUT" - - - name: Create or update tagged release and upload versioned tarball - id: gh_release_tag - uses: softprops/action-gh-release@v1 - with: - tag_name: "openapi-v${{ needs.pack.outputs.version }}" - name: "openapi v${{ needs.pack.outputs.version }}" - body: "Automated release for packages/openapi (pack + upload)" - files: ${{ steps.find.outputs.pack_path }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Create or update 'latest' release and upload stable tarball - id: gh_release_latest - uses: softprops/action-gh-release@v1 - with: - tag_name: "openapi-latest" - name: "openapi latest" - body: "Automated release for packages/openapi (latest)" - files: ${{ steps.find.outputs.latest_path }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - rebuild-schema: - runs-on: ubuntu-latest - environment: production - needs: - - release-openapi-packages - steps: - - name: Trigger autoupdate swagger - env: - GH_ORG_ACCESS_TOKEN: ${{ secrets.GH_ORG_ACCESS_TOKEN }} - OPENAPI_REPO: ${{ secrets.OPENAPI_REPO }} - run: | - curl -X POST \ - -H "Authorization: Bearer $GH_ORG_ACCESS_TOKEN" \ - -H "Accept: application/vnd.github+json" \ - https://api.github.com/repos/$OPENAPI_REPO/dispatches \ - -d '{"event_type":"api-docs-release"}' diff --git a/.github/workflows/deploy-openapi-assets.yml b/.github/workflows/deploy-openapi-assets.yml index 783c73de..d650666d 100644 --- a/.github/workflows/deploy-openapi-assets.yml +++ b/.github/workflows/deploy-openapi-assets.yml @@ -4,12 +4,125 @@ on: push: branches: [main] paths: - - 'packages/openapi/**' + - "packages/openapi/**" jobs: - trigger: + pack: runs-on: ubuntu-latest environment: production + permissions: + contents: read + outputs: + version: ${{ steps.set-outputs.outputs.version }} + packfile_name: ${{ steps.set-outputs.outputs.packfile_name }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "20" + + - id: set-outputs + name: Pack @docs/openapi and upload artifacts + run: | + set -euo pipefail + cd packages/openapi + + echo "Working dir: $(pwd)" + cat package.json + + npm ci + + # npm pack prints the filename; grab the last non-empty line + PACKFILE=$(npm pack | sed -n '/./p' | tail -n1) + echo "Packed file: $PACKFILE" + + # create stable 'latest' name + LATEST_NAME="openapi-latest.tgz" + cp -f "$PACKFILE" "$LATEST_NAME" + + # ensure files exist + ls -la + + VERSION=$(node -p "require('./package.json').version") + echo "version=$VERSION" >> "$GITHUB_OUTPUT" + echo "packfile_name=$PACKFILE" >> "$GITHUB_OUTPUT" + + - name: Upload tarballs as artifact + uses: actions/upload-artifact@v4 + with: + name: openapi-tarballs + path: | + packages/openapi/${{ steps.set-outputs.outputs.packfile_name }} + packages/openapi/openapi-latest.tgz + + release-openapi-packages: + runs-on: ubuntu-latest + needs: pack + environment: production + permissions: + contents: write + steps: + - name: Checkout (needed for workspace) + uses: actions/checkout@v4 + + - name: Download packed artifacts + uses: actions/download-artifact@v4 + with: + name: openapi-tarballs + path: artifacts + + - name: Show artifacts (debug) + run: ls -la artifacts || true + + - name: Resolve artifact paths + id: find + run: | + set -euo pipefail + PACKFILE="${{ needs.pack.outputs.packfile_name }}" + PACK_PATH=$(find artifacts -type f -name "$PACKFILE" -print -quit || true) + LATEST_PATH=$(find artifacts -type f -name "openapi-latest.tgz" -print -quit || true) + + echo "Found pack path: $PACK_PATH" + echo "Found latest path: $LATEST_PATH" + if [ -z "$PACK_PATH" ] || [ -z "$LATEST_PATH" ]; then + echo "::error::Missing artifact(s). Debug listing:" + ls -Rla artifacts || true + exit 1 + fi + + echo "pack_path=$PACK_PATH" >> "$GITHUB_OUTPUT" + echo "latest_path=$LATEST_PATH" >> "$GITHUB_OUTPUT" + + - name: Create or update tagged release and upload versioned tarball + id: gh_release_tag + uses: softprops/action-gh-release@v1 + with: + tag_name: "openapi-v${{ needs.pack.outputs.version }}" + name: "OpenAPI v${{ needs.pack.outputs.version }}" + body: "Automated release for packages/openapi (pack + upload)" + files: ${{ steps.find.outputs.pack_path }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Create or update 'latest' release and upload stable tarball + id: gh_release_latest + uses: softprops/action-gh-release@v1 + with: + tag_name: "openapi-latest" + name: "OpenAPI" + body: "Automated release for packages/openapi (latest)" + files: ${{ steps.find.outputs.latest_path }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + rebuild-schema: + runs-on: ubuntu-latest + environment: production + needs: + - release-openapi-packages steps: - name: Trigger autoupdate swagger env: From fae4dcd5ef4fee962e3bcd2430889d93d95bee95 Mon Sep 17 00:00:00 2001 From: Daniil Bombenkov Date: Wed, 10 Dec 2025 10:56:28 +0300 Subject: [PATCH 2/2] fix: branch --- .github/workflows/deploy-openapi-assets.yml | 2 +- packages/openapi/descriptions/assistant-thread.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-openapi-assets.yml b/.github/workflows/deploy-openapi-assets.yml index 3cac7214..1bf54c33 100644 --- a/.github/workflows/deploy-openapi-assets.yml +++ b/.github/workflows/deploy-openapi-assets.yml @@ -2,7 +2,7 @@ name: Deploy Openapi Assets on: push: - branches: [main] + branches: [main, feat-openapi-package] paths: - "packages/openapi/**" diff --git a/packages/openapi/descriptions/assistant-thread.js b/packages/openapi/descriptions/assistant-thread.js index f6f3a320..db960b20 100644 --- a/packages/openapi/descriptions/assistant-thread.js +++ b/packages/openapi/descriptions/assistant-thread.js @@ -9,7 +9,7 @@ export default { desc: `The object type.`, }, role: { - desc: `The role of the entity that is creating the Message.`, + desc: `The role of the entity that is creating the Message`, }, content: { text: {