Skip to content

Commit a8a2e10

Browse files
author
beicause
committed
Add github CI
1 parent 5d4b7ac commit a8a2e10

File tree

4 files changed

+1903
-0
lines changed

4 files changed

+1903
-0
lines changed

.github/workflows/ci.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: 🛠️ Builds
2+
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
pull_request:
8+
branches:
9+
- master
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
build:
17+
strategy:
18+
matrix:
19+
os: [macos-latest, ubuntu-latest, windows-latest]
20+
runs-on: ${{ matrix.os }}
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Install Node.js
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: 18.x
29+
30+
- name: Run npm install
31+
run: npm install
32+
33+
- name: Run pretest
34+
run: xvfb-run -a npm run pretest
35+
if: runner.os == 'Linux'
36+
37+
- name: Run pretest
38+
run: npm run pretest
39+
if: runner.os != 'Linux'
40+
41+
- name: Run vsce package
42+
run: mkdir -p out/vsix && npm exec vsce package -- -o out/vsix/
43+
44+
- name: Upload artifact
45+
uses: actions/upload-artifact@v2
46+
with:
47+
name: ${{ github.event.repository.name }}
48+
path: |
49+
${{ github.workspace }}/out/vsix/

.github/workflows/deploy.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: 🛠️ Release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
tags:
8+
- 'v*'
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
deploy:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Install Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: 18.x
24+
25+
- name: Run npm install
26+
run: npm install
27+
28+
- name: Run vsce package
29+
run: mkdir -p out/vsix && npm exec vsce package -- -o out/vsix/
30+
31+
- name: Create Github Release
32+
uses: softprops/action-gh-release@v2
33+
with:
34+
files: out/vsix/*.vsix
35+
36+
- name: Publish to VS Code Marketplace
37+
if: success() && startsWith(github.ref, 'refs/tags/') && matrix.os == 'ubuntu-latest'
38+
run: npm run deploy
39+
env:
40+
VSCE_PAT: ${{ secrets.VSCE_PAT }}
41+
42+
- name: Publish to Open VSX
43+
if: success() && startsWith(github.ref, 'refs/tags/') && matrix.os == 'ubuntu-latest'
44+
run: npm run deploy_ovsx -p ${{ secrets.OVSX_PAT }}

0 commit comments

Comments
 (0)