From f6839564a90994b535d0f5000dda903b45850804 Mon Sep 17 00:00:00 2001 From: Savitha Raghunathan Date: Mon, 30 Sep 2024 13:55:40 -0400 Subject: [PATCH] Integrating release workflow - initial build, test, package, and upload artifacts to the ci runs. Signed-off-by: Savitha Raghunathan --- .github/workflows/release.yml | 114 ++++++++++++++++++++++++++++++++++ vscode/.vscodeignore | 2 +- vscode/README.md | 60 ++---------------- 3 files changed, 121 insertions(+), 55 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..43d8eb43 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,114 @@ +name: Release + +on: + push: + branches: + - "main" + - "release-*" + + pull_request: + branches: + - "main" + - "release-*" + + workflow_dispatch: + inputs: + release_branch: + description: 'Branch to release (e.g., main, release-1.0)' + default: 'main' + run_tests: + description: 'Run tests before packaging and releasing (true/false)' + default: 'true' + +jobs: + build: + name: Build and Release (${{ matrix.arch }}) + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - os: ubuntu-latest + arch: linux + - os: macos-latest + arch: macos + - os: windows-latest + arch: windows + max-parallel: 3 + + steps: + - name: Check if architecture is selected + id: check_arch + shell: bash + run: | + echo "Selected architectures: ${{ github.event.inputs.architectures }}" + if [[ "${{ github.event.inputs.architectures }}" == *"${{ matrix.arch }}"* ]]; then + echo "should_build=true" >> $GITHUB_OUTPUT + else + echo "should_build=false" >> $GITHUB_OUTPUT + fi + + - name: Skip job if architecture not selected + if: ${{ steps.check_arch.outputs.should_build == 'false' }} + run: | + echo "Skipping build for architecture ${{ matrix.arch }}" + exit 0 + + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: ${{ github.event.inputs.release_branch || github.ref }} + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version-file: "vscode/.nvmrc" + + - name: Install dependencies + working-directory: ./vscode + run: npm ci + + - name: Lint sources + working-directory: ./vscode + run: npm run lint + + - name: Build + working-directory: ./vscode + run: npm run package + + # Install Xvfb on Linux + - name: Install Xvfb (Linux) + if: ${{ runner.os == 'Linux' }} + run: sudo apt-get install -y xvfb + + # Run tests on Linux + - name: Run tests (Linux) + if: ${{ github.event.inputs.run_tests == 'true' && runner.os == 'Linux' }} + working-directory: ./vscode + run: xvfb-run npm test + shell: bash + + # Run tests on macOS + - name: Run tests (macOS) + if: ${{ github.event.inputs.run_tests == 'true' && runner.os == 'macOS' }} + working-directory: ./vscode + run: npm test + shell: bash + + # Run tests on Windows + - name: Run tests (Windows) + if: ${{ github.event.inputs.run_tests == 'true' && runner.os == 'Windows' }} + working-directory: ./vscode + run: npm test + shell: cmd + + - name: Generate .vsix package + working-directory: ./vscode + run: | + npm install @vscode/vsce + npx vsce package + + - name: Upload VSIX artifact + uses: actions/upload-artifact@v4 + with: + name: vscode-extension-${{ matrix.arch }}-${{ github.run_id }} + path: "vscode/*.vsix" \ No newline at end of file diff --git a/vscode/.vscodeignore b/vscode/.vscodeignore index d255964e..966f169b 100644 --- a/vscode/.vscodeignore +++ b/vscode/.vscodeignore @@ -1,6 +1,6 @@ .vscode/** .vscode-test/** -out/** +test_out/** node_modules/** src/** .gitignore diff --git a/vscode/README.md b/vscode/README.md index 4f5c16a3..635e68f7 100644 --- a/vscode/README.md +++ b/vscode/README.md @@ -1,71 +1,23 @@ # konveyor-vscode README -This is the README for your extension "konveyor-vscode". After writing up a brief description, we recommend including the following sections. +This extension allows the user to run Konveyor AI from VSCode. ## Features -Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file. - -For example if there is an image subfolder under your extension project workspace: - -\!\[feature X\]\(images/feature-x.png\) - -> Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow. +TODO ## Requirements -If you have any requirements or dependencies, add a section describing those and how to install and configure them. +TODO ## Extension Settings -Include if your extension adds any VS Code settings through the `contributes.configuration` extension point. - -For example: - -This extension contributes the following settings: - -* `myExtension.enable`: Enable/disable this extension. -* `myExtension.thing`: Set to `blah` to do something. +TODO ## Known Issues -Calling out known issues can help limit users opening duplicate issues against your extension. +TODO ## Release Notes -Users appreciate release notes as you update your extension. - -### 1.0.0 - -Initial release of ... - -### 1.0.1 - -Fixed issue #. - -### 1.1.0 - -Added features X, Y, and Z. - ---- - -## Following extension guidelines - -Ensure that you've read through the extensions guidelines and follow the best practices for creating your extension. - -* [Extension Guidelines](https://code.visualstudio.com/api/references/extension-guidelines) - -## Working with Markdown - -You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts: - -* Split the editor (`Cmd+\` on macOS or `Ctrl+\` on Windows and Linux). -* Toggle preview (`Shift+Cmd+V` on macOS or `Shift+Ctrl+V` on Windows and Linux). -* Press `Ctrl+Space` (Windows, Linux, macOS) to see a list of Markdown snippets. - -## For more information - -* [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown) -* [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/) - -**Enjoy!** +TODO