-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (47 loc) · 1.4 KB
/
build-test-package.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
name: Reusable WF - Build
on:
workflow_call:
inputs:
version:
required: false
default: ''
type: string
outputs:
package-version:
value: ${{ jobs.build.outputs.package-version }}
defaults:
run:
shell: bash
jobs:
build:
runs-on: ubuntu-latest
outputs:
package-version: ${{ steps.get-version.outputs.package-version }}
steps:
- uses: actions/checkout@v3
- name: Install nodejs
uses: actions/setup-node@v3
with:
node-version: 'lts/hydrogen'
- name: Update version for prerelease build
if: inputs.version != ''
run: |
npm version ${{ inputs.version }} --git-tag-version false
- name: Yoink version tag from package.json
id: get-version
run: |
node -e "console.log('package-version=' + require('./package.json').version)" >> $GITHUB_OUTPUT
node -e "console.log('PACKAGE_VERSION=' + require('./package.json').version)" >> $GITHUB_ENV
- name: Package
run: |
npm ci
npm run vscode:package
- name: Clean up dir
run: |
rm -rf dist/
- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
name: amalgam-lang-${{ env.PACKAGE_VERSION }}.vsix
path: ./amalgam-lang-${{ env.PACKAGE_VERSION }}.vsix
if-no-files-found: error