forked from bytecodealliance/wasm-micro-runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (68 loc) · 2.54 KB
/
build_wamr_vscode_ext.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
# Copyright (C) 2019 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
name: build wamr-ide vscode extension
on:
workflow_call:
inputs:
upload_url:
description: upload binary assets to the URL of release
type: string
required: true
ver_num:
description: a semantic version number.
type: string
required: true
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-22.04
permissions:
contents: write # for uploading release artifacts
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: 18.x
- name: set vscode extension to correct version
run: |
npm install -g json
json -I -f package.json -e "this.version=\"${{ inputs.ver_num }}\""
working-directory: test-tools/wamr-ide/VSCode-Extension
- name: generate wamr ide vscode extension
run: |
npm install -g @vscode/vsce
rm -rf node_modules
npm install
vsce package
working-directory: test-tools/wamr-ide/VSCode-Extension
- name: publish wamr ide vscode extension to the vsce marketplace
if: ${{ github.repository == 'bytecodealliance/wasm-micro-runtime' }}
run: |
vsce publish -p ${{ secrets.TOKEN }}
working-directory: test-tools/wamr-ide/VSCode-Extension
- name: compress the vscode extension
run: |
mv wamride-*.vsix wamr-ide.vsix
tar czf wamr-ide-${{ inputs.ver_num }}.tar.gz wamr-ide.vsix
zip wamr-ide-${{ inputs.ver_num }}.zip wamr-ide.vsix
working-directory: test-tools/wamr-ide/VSCode-Extension
- name: upload release tar.gz
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ inputs.upload_url }}
asset_path: test-tools/wamr-ide/VSCode-Extension/wamr-ide-${{ inputs.ver_num }}.tar.gz
asset_name: wamr-ide-${{ inputs.ver_num }}.tar.gz
asset_content_type: application/x-gzip
- name: upload release zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ inputs.upload_url }}
asset_path: test-tools/wamr-ide/VSCode-Extension/wamr-ide-${{ inputs.ver_num }}.zip
asset_name: wamr-ide-${{ inputs.ver_num }}.zip
asset_content_type: application/zip