diff --git a/.github/workflows/update-versions.json b/.github/workflows/update-versions.json new file mode 100644 index 0000000..03bc292 --- /dev/null +++ b/.github/workflows/update-versions.json @@ -0,0 +1,27 @@ +name: Update Version + +on: + release: + types: [published] + +jobs: + update-version: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Update js/versions.js + run: | + version=$(echo ${{ github.ref }} | sed 's/refs\/tags\///') + date=$(date +'%Y-%m-%d') + sed -i "s/version: \".*\"/version: \"$version\"/" js/versions.js + sed -i "s/releaseDate: \".*\"/releaseDate: \"$date\"/" js/versions.js + sed -i "/changelog: \[/a\ {\n version: \"$version\",\n date: \"$date\",\n changes: [\n \"New release\"\n ]\n }," js/versions.js + + - name: Commit and push if changed + run: | + git config --global user.name 'GitHub Action' + git config --global user.email 'action@github.com' + git add js/versions.js + git commit -m "Update version to ${{ github.ref_name }}" || exit 0 + git push \ No newline at end of file diff --git a/js/gtUIContextMenu.js b/js/gtUIContextMenu.js index 90839c6..2d38016 100644 --- a/js/gtUIContextMenu.js +++ b/js/gtUIContextMenu.js @@ -1,6 +1,6 @@ import { getStorageValue, setStorageValue } from "../../scripts/utils.js"; - +import { versions } from "./versions.js"; export const griptapeMenuItems = [ // // TODO: Figure out how to pull and set the environment variables // { @@ -29,32 +29,13 @@ export const griptapeMenuItems = [ }, }, { - content: "----------------", + content: `📦 Version: ${versions.version}`, + disabled: true, // This makes it non-clickable + }, + { + content: "----------------------", disabled: true, }, - // // Set automatic node colors on or off - // { - // content: "🎨 Node Colors On", - // callback: (...args) => { - // setStorageValue( - // "Comfy.Griptape.ColorNodes", - // true - // ); - // }, - // }, - // { - // content: "🎨 Node Colors Off", - // callback: (...args) => { - // setStorageValue( - // "Comfy.Griptape.ColorNodes", - // false - // ); - // }, - // }, - // { - // content: "", - // disabled: true, - // }, { content: "Griptape Home", callback: (...args) => {