Skip to content

ci: update release default bundle to include the UI charts plugin (#292) #4

ci: update release default bundle to include the UI charts plugin (#292)

ci: update release default bundle to include the UI charts plugin (#292) #4

name: Release Default Bundle
on:
push:
tags:
- 'bundle@*'
workflow_dispatch:
inputs:
tag:
description: "Tag (e.g. bundle@1.2.3 or v1.2.3)"
required: false
jobs:
build-and-publish:
name: Build and Publish Default Bundle
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: '24'
cache: 'npm'
cache-dependency-path: Plugins/UI/default-scriptbee-charts/package-lock.json
- name: Extract version from tag
id: meta
shell: bash
run: |
INPUT_TAG="${{ github.event.inputs.tag }}"
if [ -n "$INPUT_TAG" ]; then
REF_NAME="$INPUT_TAG"
else
REF_NAME="$GITHUB_REF_NAME"
fi
if [[ "$REF_NAME" == *"@"* ]]; then
VERSION="${REF_NAME#*@}"
else
VERSION="${REF_NAME#v}"
fi
VERSION="${VERSION#v}"
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "zip_name=scriptbee-default-bundle-$VERSION.zip" >> $GITHUB_OUTPUT
- name: Install zip
run: sudo apt-get install -y zip
- name: Prepare and zip default plugin bundle
run: |
chmod +x ./scripts/create_default_bundle_zip.sh
chmod +x ./scripts/prepare_default_plugin_bundle.sh
chmod +x ./scripts/prepare_plugin_folder.sh
chmod +x ./scripts/prepare_ui_charts_plugin.sh
sh ./scripts/create_default_bundle_zip.sh "${{ steps.meta.outputs.version }}" "${{ steps.meta.outputs.zip_name }}"
- name: Upload bundle artifact
uses: actions/upload-artifact@v7
with:
name: default-bundle
path: ${{ steps.meta.outputs.zip_name }}
create-release:
name: Create GitHub Release
needs: build-and-publish
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Extract version from tag
id: meta
shell: bash
run: |
INPUT_TAG="${{ github.event.inputs.tag }}"
if [ -n "$INPUT_TAG" ]; then
REF_NAME="$INPUT_TAG"
else
REF_NAME="$GITHUB_REF_NAME"
fi
if [[ "$REF_NAME" == *"@"* ]]; then
VERSION="${REF_NAME#*@}"
else
VERSION="${REF_NAME#v}"
fi
VERSION="${VERSION#v}"
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "zip_name=scriptbee-default-bundle-$VERSION.zip" >> $GITHUB_OUTPUT
- name: Download bundle artifact
uses: actions/download-artifact@v8
with:
name: default-bundle
path: dist
- name: Extract changelog for current version
id: changelog
run: |
chmod +x ./scripts/extract_changelog.sh
./scripts/extract_changelog.sh "${{ steps.meta.outputs.version }}" Plugins/CHANGELOG.md
- name: Create Release
uses: softprops/action-gh-release@v3
with:
tag_name: ${{ github.event.inputs.tag || github.ref_name }}
body_path: RELEASE_NOTES.md
files: dist/${{ steps.meta.outputs.zip_name }}