Skip to content

Commit

Permalink
Merge pull request #67 from digma-ai/fix/display-version
Browse files Browse the repository at this point in the history
Add bump version workflow, display version in index.html
  • Loading branch information
kshmidt-digma authored Dec 14, 2024
2 parents a390660 + 43ba23a commit 7b558ac
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/digma-bump.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Bump Digma Jaeger UI version and push git tag

on:
workflow_dispatch:
inputs:
version:
description: 'Version to set (e.g., 1.2.3)'
required: true

jobs:
bump:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.RELEASE_PAT }}

- run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Get version
run: |
VERSION=$(jq -r '.version' ./packages/jaeger-ui/package.json)
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Update digma-jaeger-ui version
run: |
jq '.["digma-jaeger-ui-version"] = "${{ inputs.version }}"' ./packages/jaeger-ui/package.json > tmp.$$.json && mv tmp.$$.json ./packages/jaeger-ui/package.json
- run: |
git add packages/jaeger-ui/package.json
git commit -m "Bump Digma Jaeger UI version to ${{ inputs.version }} [skip ci]"
git tag "v${{ env.VERSION }}-digma.${{ inputs.version }}"
git push
git push origin "v${{ inputs.version }}"
1 change: 1 addition & 0 deletions packages/jaeger-ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="digma-jaeger-ui-version" content="__DIGMA_JAEGER_UI_VERSION__">
<!-- prevent caching of this HTML by any server, Go or otherwise -->
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
Expand Down
1 change: 1 addition & 0 deletions packages/jaeger-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"private": true,
"name": "jaeger-ui",
"version": "1.29.1",
"digma-jaeger-ui-version": "1.0.2",
"main": "src/index.tsx",
"license": "Apache-2.0",
"homepage": ".",
Expand Down
13 changes: 13 additions & 0 deletions packages/jaeger-ui/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import react from '@vitejs/plugin-react';
import legacy from '@vitejs/plugin-legacy';
import vitePluginImp from 'vite-plugin-imp';
import visualizer from 'rollup-plugin-visualizer';
import { readFileSync } from 'fs';
import { resolve } from 'path';

const proxyConfig = {
target: 'http://localhost:16686',
Expand All @@ -27,6 +29,8 @@ const proxyConfig = {
xfwd: true,
};

const packageJson = JSON.parse(readFileSync(resolve(__dirname, 'package.json'), 'utf-8'));

// https://vitejs.dev/config/
export default defineConfig({
define: {
Expand Down Expand Up @@ -61,6 +65,15 @@ export default defineConfig({
}),
// Generate a bundle size breakdown.
visualizer(),
{
name: 'html-transform',
transformIndexHtml(html) {
return html.replace(
'__DIGMA_JAEGER_UI_VERSION__',
`${packageJson.version}-digma.${packageJson['digma-jaeger-ui-version']}`
);
},
},
],
css: {
preprocessorOptions: {
Expand Down

0 comments on commit 7b558ac

Please sign in to comment.