Skip to content

Commit

Permalink
feat: setup ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Lakphy committed Nov 10, 2024
1 parent 7d42610 commit e68b250
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1 deletion.
50 changes: 50 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Publish to VSCode Marketplace

on:
push:
branches:
- main

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"

- name: Setup PNPM
uses: pnpm/action-setup@v2
with:
version: 8

- name: Get version from package.json
id: package-version
uses: martinbeentjes/npm-get-version-action@v1.3.1

- name: Create Git tag
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git tag -a v${{ steps.package-version.outputs.current-version}} -m "Release v${{ steps.package-version.outputs.current-version}}"
git push origin v${{ steps.package-version.outputs.current-version}}
- name: Install dependencies
run: pnpm install

- name: Login to VSCode Marketplace
run: |
vsce login lakphy
${{ secrets.VSCODE_TOKEN }}
- name: Publish to VSCode Marketplace
run: pnpm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"displayName": "prompter-by-lakphy",
"description": "prompt manage tool",
"version": "0.0.1",
"publisher": "lakphy",
"engines": {
"vscode": "^1.95.0"
},
Expand Down Expand Up @@ -108,7 +109,8 @@
"watch-tests": "tsc -p . -w --outDir out",
"pretest": "pnpm run compile-tests && pnpm run compile && pnpm run lint",
"lint": "eslint src --ext ts",
"test": "vscode-test"
"test": "vscode-test",
"publish": "pnpm vsce publish --no-dependencies"
},
"devDependencies": {
"@types/vscode": "^1.95.0",
Expand Down

0 comments on commit e68b250

Please sign in to comment.