Skip to content

Build Operations Button Widget #12

Build Operations Button Widget

Build Operations Button Widget #12

Workflow file for this run

name: Build Operations Button Widget
# Controls when the workflow will run
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: build
uses: actions/setup-node@v2
with:
node-version: 14.x
- run: npm ci
- name: Read @c8y/client version
id: c8y_version
run: |
echo "c8y_version=$(npm info @c8y/client version)" >> $GITHUB_OUTPUT
echo "::debug::Version is ${{ steps.c8y_version.outputs.c8y_version }}"
- name: Create Build
run: npm run build-ci --if-present
- name: Zip Frontend
run: |
cd operations-button/dist/apps/operations-button
zip -r -q ../../../../operations-button-plugin.zip *
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
C8Y_VERSION: ${{ steps.c8y_version.outputs.c8y_version }}
with:
tag_name: ${{ steps.c8y_version.outputs.c8y_version }}
release_name: Release ${{ steps.c8y_version.outputs.c8y_version }}
draft: false
prerelease: false
- name: Upload Release Asset Frontend
id: upload-release-asset-frontend
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./operations-button-plugin.zip
asset_name: operations-button-plugin.zip
asset_content_type: application/zip