-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (46 loc) · 1.64 KB
/
Build.yaml
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
name: Build
on:
workflow_call:
outputs:
artifact-url:
value: ${{ jobs.build.outputs.artifact-url }}
commit-hash:
value: ${{ jobs.build.outputs.commit-hash }}
extension-version:
value: ${{ jobs.build.outputs.extension-version }}
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['22.x']
outputs:
artifact-url: ${{ steps.upload-artifact.outputs.artifact-url }}
commit-hash: ${{ steps.get-version.outputs.commitHash }}
extension-version: ${{ steps.get-version.outputs.extensionVersion }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Get Extension Version
id: get-version
shell: bash
run: |
extensionVersion=$(node -p "require('./package.json').version")
echo "extensionVersion=$extensionVersion" >> $GITHUB_ENV
echo "extensionVersion=$extensionVersion" >> $GITHUB_OUTPUT
echo "commitHash=$(git log --format="%H" | head -n 1)" >> $GITHUB_OUTPUT
- name: Package VS Code extension
id: package
uses: nhedger/package-vscode-extension@main
- name: Upload artifact
uses: actions/upload-artifact@v4
id: upload-artifact
with:
name: soberjs-vscode-${{ env.extensionVersion }}.vsix
path: /home/runner/work/soberjs-vscode/soberjs-vscode/soberjs-vscode-${{ env.extensionVersion }}.vsix
compression-level: 0
if-no-files-found: error