Skip to content

Commit

Permalink
root
Browse files Browse the repository at this point in the history
  • Loading branch information
hyrious committed Dec 4, 2024
0 parents commit 84055a9
Show file tree
Hide file tree
Showing 58 changed files with 311,355 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build VS Code Extension

on:
push:
branches:
- "*"

permissions:
contents: write

jobs:
build:
name: "Build VS Code Extension"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform:
[
"win32-arm64",
"win32-x64",
"linux-arm64",
"linux-x64",
"linux-armhf",
"alpine-x64",
"darwin-x64",
"darwin-arm64",
"alpine-arm64",
]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Install dependencies
run: npm install

- name: Checking Linting
run: npm run lint

- name: Compile Extension
run: npm run package -- --target ${{ matrix.platform }}

- name: Package extension
run: npx vsce package --target ${{ matrix.platform }} --out "oopilot-${{ matrix.platform }}.vsix"

- name: Upload extension vsix as artifact
uses: actions/upload-artifact@v4
with:
name: "oopilot-${{ matrix.platform }}.vsix"
path: "oopilot-${{ matrix.platform }}.vsix"
105 changes: 105 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Release VS Code Extension

permissions:
contents: write

on:
release:
types: [created]

jobs:
release-job:
name: "Release VS Code Extension"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform:
[
"win32-arm64",
"win32-x64",
"linux-arm64",
"linux-x64",
"linux-armhf",
"alpine-x64",
"darwin-x64",
"darwin-arm64",
"alpine-arm64",
]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Verify version match
run: |
# Get version from package.json
PKG_VERSION=$(node -p "require('./package.json').version")
# Get release version
RELEASE_VERSION=${GITHUB_REF#refs/tags/}
# Validate release tag format
if ! [[ $RELEASE_VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Error: Invalid release tag format!"
echo "Release tag must follow the format: 1.2.3 (MAJOR.MINOR.PATCH)"
echo "Got: $RELEASE_VERSION"
exit 1
fi
# Validate package.json version format
if ! [[ $PKG_VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Error: Invalid package.json version format!"
echo "Version must follow SemVer format: 1.2.3 (MAJOR.MINOR.PATCH)"
echo "Got: $PKG_VERSION"
exit 1
fi
echo "Package.json version: $PKG_VERSION"
echo "Release version: $RELEASE_VERSION"
# Check if package.json version matches release version
if [ "$PKG_VERSION" != "$RELEASE_VERSION" ]; then
echo "Error: Version mismatch!"
echo "package.json version ($PKG_VERSION) does not match release version ($RELEASE_VERSION)"
exit 1
fi
- name: Install dependencies
run: npm install

- name: Checking Linting
run: npm run lint

- name: Compile Extension
run: npm run package -- --target ${{ matrix.platform }}

- name: Package extension
run: npx vsce package --target ${{ matrix.platform }} --out "oopilot-${{ matrix.platform }}.vsix"

- name: Upload extension vsix as artifact
uses: actions/upload-artifact@v4
with:
name: "oopilot-${{ matrix.platform }}.vsix"
path: "oopilot-${{ matrix.platform }}.vsix"

- name: Upload Release Assets
uses: softprops/action-gh-release@v2
with:
files: "oopilot-${{ matrix.platform }}.vsix"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# - name: Release to VS Code Marketplace
# uses: nick-fields/retry@v3
# with:
# timeout_minutes: 5
# max_attempts: 6
# retry_on: error
# retry_wait_seconds: 10
# command: npx vsce publish --packagePath "oopilot-${{ matrix.platform }}.vsix" -p ${{ secrets.VSCODE_MARKETPLACE_TOKEN }}
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
out
node_modules
.vscode-test/
*.vsix
.DS_Store
launch_folder
types/
extension.vsix
extension.hash
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"tabWidth": 2,
"useTabs": false
}
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": ["dbaeumer.vscode-eslint", "amodio.tsl-problem-matcher"]
}
25 changes: 25 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// A launch configuration that compiles the extension and then opens it inside a new window
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"${workspaceFolder}/launch_folder",
"--extensionDevelopmentPath=${workspaceFolder}",
"--disable-extensions",
"--enable-proposed-api=flexpilot.flexpilot-vscode-extension"
],
"outFiles": ["${workspaceFolder}/out/**/*.js"],
"env": {
"FLEXPILOT_DEV_MODE": "true"
},
"preLaunchTask": "${defaultBuildTask}"
}
]
}
48 changes: 48 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"search.exclude": { "out": true },
"files.exclude": { "out": false },
"typescript.tsc.autoDetect": "off",
"prettier.prettierPath": "./node_modules/prettier",
"editor.formatOnSave": true,
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.indentSize": "tabSize",
"editor.insertSpaces": true,
"editor.tabSize": 2,
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
}
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.indentSize": "tabSize",
"editor.insertSpaces": true,
"editor.tabSize": 2,
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
}
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.indentSize": "tabSize",
"editor.insertSpaces": true,
"editor.tabSize": 2,
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
}
},
"cSpell.words": [
"Codestral",
"davinci",
"flexpilot",
"Groq",
"groqcloud",
"ISCM",
"Kwargs",
"machineid",
"mistralai",
"NOSONAR",
"softprops",
"uuidv"
]
}
21 changes: 21 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "watch",
"problemMatcher": "$ts-webpack-watch",
"isBackground": true,
"presentation": {
"reveal": "never",
"group": "watchers"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
20 changes: 20 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.vscode/**
.vscode-test/**
node_modules/**
src/**
.gitignore
.yarnrc
webpack.config.js
vsc-extension-quickstart.md
**/tsconfig.json
**/.eslintrc.json
**/*.map
**/*.ts
**/.vscode-test.*
.github
launch_folder
types
build/**
tokenizers/**
.husky/**
eslint.config.mjs
Loading

0 comments on commit 84055a9

Please sign in to comment.