2022-10-28 05:55:41 +00:00
|
|
|
# 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
|
|
|
|
|
2024-10-22 01:13:55 +00:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2022-10-28 05:55:41 +00:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-22.04
|
2024-10-22 01:13:55 +00:00
|
|
|
permissions:
|
|
|
|
contents: write # for uploading release artifacts
|
|
|
|
|
2022-10-28 05:55:41 +00:00
|
|
|
steps:
|
2024-01-26 23:55:49 +00:00
|
|
|
- uses: actions/checkout@v4
|
2022-10-28 05:55:41 +00:00
|
|
|
|
2024-08-20 09:03:28 +00:00
|
|
|
- name: Use Node.js 18.x
|
2024-04-12 03:33:30 +00:00
|
|
|
uses: actions/setup-node@v4
|
2022-10-28 05:55:41 +00:00
|
|
|
with:
|
2024-08-20 09:03:28 +00:00
|
|
|
node-version: 18.x
|
2023-03-26 04:19:45 +00:00
|
|
|
|
|
|
|
- name: set vscode extension to correct version
|
2022-10-28 05:55:41 +00:00
|
|
|
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: |
|
2024-08-20 09:03:28 +00:00
|
|
|
npm install -g @vscode/vsce
|
2022-10-28 05:55:41 +00:00
|
|
|
rm -rf node_modules
|
|
|
|
npm install
|
|
|
|
vsce package
|
2023-04-19 11:39:01 +00:00
|
|
|
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: |
|
2023-04-04 04:13:40 +00:00
|
|
|
vsce publish -p ${{ secrets.TOKEN }}
|
2022-10-28 05:55:41 +00:00
|
|
|
working-directory: test-tools/wamr-ide/VSCode-Extension
|
|
|
|
|
|
|
|
- name: compress the vscode extension
|
|
|
|
run: |
|
2022-12-24 01:17:39 +00:00
|
|
|
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
|
2022-10-28 05:55:41 +00:00
|
|
|
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 }}
|
2022-12-24 01:17:39 +00:00
|
|
|
asset_path: test-tools/wamr-ide/VSCode-Extension/wamr-ide-${{ inputs.ver_num }}.tar.gz
|
|
|
|
asset_name: wamr-ide-${{ inputs.ver_num }}.tar.gz
|
2022-10-28 05:55:41 +00:00
|
|
|
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 }}
|
2022-12-24 01:17:39 +00:00
|
|
|
asset_path: test-tools/wamr-ide/VSCode-Extension/wamr-ide-${{ inputs.ver_num }}.zip
|
|
|
|
asset_name: wamr-ide-${{ inputs.ver_num }}.zip
|
2022-10-28 05:55:41 +00:00
|
|
|
asset_content_type: application/zip
|