Skip to content

Commit

Permalink
Integrating release workflow - initial build, test, package, and uplo…
Browse files Browse the repository at this point in the history
…ad artifacts to the ci runs.

Signed-off-by: Savitha Raghunathan <[email protected]>
  • Loading branch information
savitharaghunathan committed Sep 30, 2024
1 parent 3602974 commit f683956
Show file tree
Hide file tree
Showing 3 changed files with 121 additions and 55 deletions.
114 changes: 114 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion vscode/.vscodeignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.vscode/**
.vscode-test/**
out/**
test_out/**
node_modules/**
src/**
.gitignore
Expand Down
60 changes: 6 additions & 54 deletions vscode/README.md
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit f683956

Please sign in to comment.