Skip to content

Commit

Permalink
chore: semantic release
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNuclearNexus committed Jan 30, 2025
1 parent 33ec330 commit 2397053
Show file tree
Hide file tree
Showing 7 changed files with 15,754 additions and 4,287 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,17 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: 18.x
node-version: 20.x
cache: 'npm'
cache-dependency-path: extension/package-lock.json
- name: Build VSC Extension
run: cd ./extension && npm ci && npm i -g vsce && vsce package
run: cd ./extension && npm i && npx vsce package
- name: Upload a Build Artifact
uses: actions/upload-artifact@v3.0.0
uses: actions/upload-artifact@v4.0.0
with:
path: 'extension/*.vsix'
name: extension
name: extension
- name: Semantic Release
run: cd ./extension && npx semantic-release
env:
VSCE_PAT: ${{secrets.MARKETPLACE_TOKEN}}
27 changes: 27 additions & 0 deletions extension/.releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"release": {
"branches": [
"main"
]
},
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"semantic-release-vsce",
{
"packageVsix": true
}
],
[
"@semantic-release/github",
{
"assets": [
{
"path": "*.vsix"
}
]
}
]
]
}
27 changes: 17 additions & 10 deletions extension/clean_zipapp.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,35 @@ const packagesToRemove = [
"numpy",
"pip",
"setuptools",
"pydantic_core",
"_pytest"
]
"pydantic",
"_pytest",
"jinja2"
];

async function main() {
const zip = await JsZip.loadAsync(fs.readFileSync("language_server.pyz"));

const paths = []
const paths = [];
zip.forEach((path, file) => {
for (const package of packagesToRemove) {
if (path.startsWith("site-packages/" + package)) {
paths.push(path)
if (path.startsWith(package)) {
paths.push(path);
return;
}
}
if (path.includes("__pycache__"))
paths.push(path)
});

for (const path of paths) {
console.log('removed', path)
zip.remove(path)
console.log("removed", path);
zip.remove(path);
}

fs.writeFileSync("language_server.pyz", await zip.generateAsync({type: "nodebuffer"}))
fs.writeFileSync(
"language_server.pyz",
await zip.generateAsync({ type: "nodebuffer" })
);
}

main()
main();
Loading

0 comments on commit 2397053

Please sign in to comment.