From 520c9ec47774ee8b44294e1daf693d8c741c16d1 Mon Sep 17 00:00:00 2001 From: John Smith Date: Tue, 10 Dec 2024 09:38:10 +1030 Subject: [PATCH] ci: Add Assistant UI pipelines --- .github/workflows/build.yml | 23 +++++++++++++++++++ .github/workflows/publish.yml | 42 +++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ed57f15d..d0d547d3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -416,6 +416,29 @@ jobs: - name: Run tests run: npm test + build-assistant-ui: + needs: check_changes + if: ${{ needs.check_changes.outputs.assistant_ui == 'true' }} + runs-on: ubuntu-latest + permissions: + contents: read + defaults: + run: + working-directory: assistant-ui + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: "npm" + cache-dependency-path: assistant-ui/package-lock.json + - name: Install dependencies + run: npm ci + - name: Build package + run: npm run build + build-load-test-machine-image: runs-on: ubuntu-latest needs: check_changes diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 12ebdc03..0e7c181e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -17,6 +17,7 @@ jobs: outputs: sdk_node: ${{ steps.filter.outputs.sdk_node }} sdk_react: ${{ steps.filter.outputs.sdk_react }} + assistant_ui: ${{ steps.filter.outputs.assistant_ui }} sdk_dotnet: ${{ steps.filter.outputs.sdk_dotnet }} sdk_go: ${{ steps.filter.outputs.sdk_go }} cli: ${{ steps.filter.outputs.cli }} @@ -35,6 +36,8 @@ jobs: - 'sdk-node/**' sdk_react: - 'sdk-react/**' + assistant_ui: + - 'assistant-ui/**' sdk_dotnet: - 'sdk-dotnet/**' sdk_go: @@ -161,6 +164,45 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + publish-assistant-ui: + needs: check_changes + if: ${{ needs.check_changes.outputs.assistant_ui == 'true' }} + runs-on: ubuntu-latest + permissions: + contents: write + packages: write + defaults: + run: + working-directory: assistant-ui + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: "npm" + cache-dependency-path: assistant-ui/package-lock.json + - name: Install dependencies + run: npm ci + - name: Build package + run: npm run build + - name: Configure Git User + run: | + git config --global user.name "Inferable CI" + git config --global user.email "ci@inferable.ai" + - name: Release It + run: | + npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN + version=$(npx release-it --release-version) + npx release-it --npm.skipChecks --git.tagName=assistant-ui/v${version} --no-github.release --git.commitMessage="Bump assistant-ui version to ${version}" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + publish-dotnet: needs: check_changes if: ${{ needs.check_changes.outputs.sdk_dotnet == 'true' }}