Skip to content

Commit

Permalink
Merge pull request #224 from smallcloudai/cicd
Browse files Browse the repository at this point in the history
update chat js artifacts
  • Loading branch information
reymondzzzz authored Feb 28, 2025
2 parents a4e47cd + f1993d6 commit 3ea088c
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 21 deletions.
33 changes: 21 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,24 @@ name: Build
on:
# Trigger the workflow on pushes to only the 'main' branch (this avoids duplicate checks being run e.g. for dependabot pull requests)
push:
branches: [main]
branches: [ main ]
# Trigger the workflow on any pull request
pull_request:
workflow_dispatch:
inputs:
chat_js_branch:
description: "Branch name of chat-js"
default: "main"
type: choice
options:
- main
- alpha
type: string
lsp_version:
description: "LSP version (leave empty to use version from refact_lsp file)"
required: false
type: string
default: ''
force_build_lsp:
type: boolean
description: Use last version of lsp from repo or force build new(for tests only)
default: true

jobs:
build:
Expand Down Expand Up @@ -52,20 +53,29 @@ jobs:
echo "lsp_version=$(cat refact_lsp)" >> $GITHUB_OUTPUT
fi
- name: Download refact-chat-js
id: download-refact-chat-js
uses: dawidd6/action-download-artifact@v3
- name: Download chat artifacts
id: download-artifact-chat
uses: dawidd6/action-download-artifact@v9
with:
github_token: ${{secrets.GITHUB_TOKEN}}
workflow: agent_gui_build.yml
workflow_search: true
repo: smallcloudai/refact
branch: ${{ inputs.chat_js_branch }}
name: refact-chat-js-latest
path: ./src/main/resources/webview/dist
path: ./chat_package
name: lts-refact-chat-js-.*\.tgz
name_is_regexp: true

- name: Prepare chat package
shell: bash
run: |
mkdir -p ./chat_package_fixed
find ./chat_package -name "*.tgz" -type f -exec tar -xzf {} -C ./chat_package_fixed/ \;
mv ./chat_package_fixed/package/dist ./src/main/resources/webview/dist
rm -rf ./chat_package ./chat_package_fixed
- uses: convictional/[email protected]
name: "Build refact-lsp"
if: ${{ inputs.force_build_lsp }}
with:
owner: smallcloudai
repo: refact
Expand All @@ -85,7 +95,6 @@ jobs:
branch: ${{ steps.setupvars.outputs.lsp_version }}
path: ./src/main/resources/bin


# Validate wrapper
- name: Gradle Wrapper Validation
uses: gradle/actions/wrapper-validation@v3
Expand Down
30 changes: 21 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ on:
description: "lsp_branch"
default: "main"
type: string
chat_js_branch:
description: "Branch name of chat-js"
default: "main"
type: string
jobs:

# Run Gradle Wrapper Validation Action to verify the wrapper's checksum
Expand Down Expand Up @@ -63,17 +67,25 @@ jobs:
echo "plugin_version=$(./gradlew properties -q | awk '/^version:/ {print $2}')" >> $GITHUB_OUTPUT
echo "lsp_version=$(cat refact_lsp)" >> $GITHUB_OUTPUT
- name: Download refact-chat-js
id: download-refact-chat-js
uses: dawidd6/action-download-artifact@v3
- name: Download chat artifacts
id: download-artifact-chat
uses: dawidd6/action-download-artifact@v9
with:
github_token: ${{secrets.GITHUB_TOKEN}}
workflow: node.js.yml
workflow_search: true
repo: smallcloudai/refact-chat-js
branch: main
name: refact-chat-js-latest
path: ./src/main/resources/webview/dist
workflow: agent_gui_build.yml
repo: smallcloudai/refact
branch: ${{ inputs.chat_js_branch }}
path: ./chat_package
name: lts-refact-chat-js-.*\.tgz
name_is_regexp: true

- name: Prepare chat package
shell: bash
run: |
mkdir -p ./chat_package_fixed
find ./chat_package -name "*.tgz" -type f -exec tar -xzf {} -C ./chat_package_fixed/ \;
mv ./chat_package_fixed/package/dist ./src/main/resources/webview/dist
rm -rf ./chat_package ./chat_package_fixed
- uses: convictional/[email protected]
name: "Build refact-lsp"
Expand Down

0 comments on commit 3ea088c

Please sign in to comment.