-
Notifications
You must be signed in to change notification settings - Fork 3
100 lines (97 loc) · 2.92 KB
/
cicd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: Build, Lint, Test and Deploy
on:
push:
branches:
- '*'
pull_request:
branches:
- master
release:
types:
- published
jobs:
build-lint-test:
name: Node ${{ matrix.node }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
fail-fast: true
matrix:
os:
- ubuntu-latest
# - macos-latest
# - windows-latest
node:
- 20
outputs:
vsixPath: ${{ steps.packageExtension.outputs.vsixPath }}
steps:
# - name: Setup GIT for Windows
# run: |
# git config --global core.autocrlf false
# git config --global core.eol lf
# if: runner.os == 'Windows'
- name: Checkout Source
uses: actions/checkout@v4
- name: Install Node ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Run Linter
run: yarn lint
- name: Build Code
run: yarn vscode:prepublish
- name: Package Extension
id: packageExtension
uses: HaaLeo/publish-vscode-extension@v1
with:
pat: stub
dryRun: true
- name: Upload Extension Package as Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}
path: ${{ steps.packageExtension.outputs.vsixPath }}
publish:
name: Publish Github Action
needs:
- build-lint-test
if: github.event_name == 'release'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout Source
uses: actions/checkout@v4
- name: Install Node v14
uses: actions/setup-node@v4
with:
node-version: 14
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Download Build Artifact
uses: actions/download-artifact@v4
with:
name: ubuntu-latest
- name: GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
body: |
# Summary
See [changelog](https://github.com/HaaLeo/vscode-timing/blob/master/CHANGELOG.md#changelog)
name: ${{ github.ref_name }}
fail_on_unmatched_files: true
files: ${{ needs.build-lint-test.outputs.vsixPath }}
- name: Publish to Visual Studio Marketplace
uses: HaaLeo/publish-vscode-extension@v1
with:
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }}
extensionFile: ${{ needs.build-lint-test.outputs.vsixPath }}
registryUrl: https://marketplace.visualstudio.com
- name: Publish to Open VSX Registry
uses: HaaLeo/publish-vscode-extension@v1
with:
pat: ${{ secrets.OPEN_VSX_TOKEN }}
extensionFile: ${{ needs.build-lint-test.outputs.vsixPath }}