Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up continuous deployment for ide-extension #446

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: Publish @inlang/core to NPM

on:
push:
paths:
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/publish-ide-extension-to-marketplace.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Publish @inlang/ide-extension to VSCode Marketplace

on:
workflow_dispatch:

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
cache: "npm-cache-for-@inlang/ide-extension"
- name: Install dependencies
run: npm ci
- name: Build project
run: npm run build
- name: Build VSCode extension package
run: npm run package -w source-code/ide-extension
- name: Publish to VSCode Marketplace
run: vsce publish -p ${{secrets.VSCODE_MARKETPLACE_TOKEN}}
working-directory: ./source-code/ide-extension
env:
VSCODE_MARKETPLACE_TOKEN: ${{secrets.VSCODE_MARKETPLACE_TOKEN}}
171 changes: 122 additions & 49 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions source-code/ide-extension/.vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ src/**
**/*.map
**/*.ts

node_modules/**
example/**
../../**
../**
15 changes: 8 additions & 7 deletions source-code/ide-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
"displayName": "inlang",
"type": "module",
"description": "i18n extension that makes you more productive.",
"publisher": "Inlang",
"publisher": "inlang",
"repository": {
"type": "git",
"url": "https://github.com/inlang/inlang.git"
},
"icon": "assets/icon.png",
"version": "0.4.3",
"engines": {
"vscode": "^1.74.1"
"vscode": "^1.75.0"
},
"categories": [
"Other",
Expand All @@ -29,12 +29,12 @@
]
},
"scripts": {
"_vscode:prepublish": "npm run build",
"_build": "rollup --config",
"build": "rollup --config",
"dev": "rollup --config --watch",
"_package": "npx vsce package",
"package": "npx vsce package",
"prepackage": "node ./scripts/preparePackage.js",
"---- TEST ----------------------------------------------------------": "",
"_test": "vitest run --coverage",
"test": "vitest run --coverage",
"---- LINT ----------------------------------------------------------": "",
"lint": "cd ../.. && npm run lint:base ./source-code/ide-extension",
"lint:fix": "cd ../.. && npm run lint:fix:base ./source-code/ide-extension",
Expand All @@ -54,7 +54,8 @@
"@rollup/plugin-typescript": "^11.0.0",
"@types/throttle-debounce": "^5.0.0",
"@types/vscode": "^1.75.0",
"@vscode/vsce": "^2.17.0",
"@vscode/vsce": "^2.18.0",
"ovsx": "^0.8.0",
"rollup": "^3.14.0"
},
"activationEvents": [
Expand Down
7 changes: 7 additions & 0 deletions source-code/ide-extension/scripts/preparePackage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import fs from "node:fs"

// change name of package
// see https://github.com/microsoft/vscode-vsce/issues/186
const packageJson = JSON.parse(fs.readFileSync("./package.json"))
packageJson.name = "vs-code-extension"
fs.writeFileSync("./package.json", JSON.stringify(packageJson, undefined, 2))