-
Notifications
You must be signed in to change notification settings - Fork 1
145 lines (121 loc) · 4.34 KB
/
Copy pathbuild-vsix.yml
File metadata and controls
145 lines (121 loc) · 4.34 KB
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: Build VSIX
on:
push:
branches: [main]
tags: ['v*']
pull_request:
branches: [main]
workflow_dispatch:
# Default least-privilege token scope; jobs that need more elevate explicitly.
permissions:
contents: read
jobs:
build-index:
runs-on: ubuntu-latest
steps:
- name: Checkout (with submodule)
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: recursive
- name: Setup Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: '3.12'
cache: pip
cache-dependency-path: scripts/requirements.txt
- name: Install dependencies
run: pip install -r scripts/requirements.txt
- name: Run Python tests
run: pytest scripts/
- name: Build keyword index
run: |
python scripts/build_keyword_index.py \
--manual-dir opm-reference-manual \
--opm-common-dir opm-common/opm/input/eclipse/share/keywords \
--output keyword_index.json \
--compact vscode-extension/data/keyword_index_compact.json
- name: Upload keyword index
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: keyword-index
path: vscode-extension/data/keyword_index_compact.json
if-no-files-found: error
package:
needs: build-index
runs-on: ubuntu-latest
permissions:
contents: write
defaults:
run:
working-directory: vscode-extension
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v6
with:
node-version: '24'
cache: npm
cache-dependency-path: vscode-extension/package-lock.json
- name: Download freshly built keyword index
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: keyword-index
path: vscode-extension/data
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test
- name: Compile TypeScript
run: npm run compile
- name: Package VSIX
run: npx --yes @vscode/vsce@3.9.1 package
- name: Upload VSIX artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: opm-flow-editor-support-vsix
path: vscode-extension/opm-flow-editor-support-*.vsix
if-no-files-found: error
- name: Attach VSIX to release
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@3d0d9888cb7fd7b750713d6e236d1fcb99157228 # v3
with:
files: vscode-extension/opm-flow-editor-support-*.vsix
publish-marketplace:
needs: package
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: Setup Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v6
with:
node-version: '24'
- name: Download VSIX
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: opm-flow-editor-support-vsix
path: .
- name: Publish to VS Code Marketplace
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
run: npx --yes @vscode/vsce@3.9.1 publish --packagePath opm-flow-editor-support-*.vsix --pat "$VSCE_PAT"
# Disabled until Open VSX account + OVSX_PAT secret are set up.
# To re-enable: change `if: false` back to `if: startsWith(github.ref, 'refs/tags/v')`.
publish-ovsx:
needs: package
if: false
runs-on: ubuntu-latest
steps:
- name: Setup Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v6
with:
node-version: '24'
- name: Download VSIX
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: opm-flow-editor-support-vsix
path: .
- name: Publish to Open VSX
env:
OVSX_PAT: ${{ secrets.OVSX_PAT }}
run: npx --yes ovsx@0.10.12 publish opm-flow-editor-support-*.vsix -p "$OVSX_PAT"