Skip to content

Commit

Permalink
added tag
Browse files Browse the repository at this point in the history
  • Loading branch information
zAlweNy26 committed Aug 4, 2023
1 parent dd35cb9 commit 1b44128
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 8 deletions.
20 changes: 13 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:
tags:
- "v*.*.*"

env:
PLUGIN_JSON: "0.0.1"

jobs:
test:

Expand All @@ -29,12 +32,15 @@ jobs:
run: |
python -m pip install --upgrade pip
if [ -f my_plugin/requirements.txt ]; then pip install -r my_plugin/requirements.txt; fi
- name: Publish GitHub release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get version
run: |
echo 'PLUGIN_JSON<<EOF' >> $GITHUB_ENV
cat ./my_plugin/plugin.json >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: Publish tag
uses: rickstaa/action-create-tag@v1
with:
tag_name: ${{ github.ref }}
draft: false
prerelease: false
tag: "${{fromJson(env.PLUGIN_JSON).version}}"
tag_exists_error: false
message: "Latest release"

15 changes: 14 additions & 1 deletion my_plugin/my_plugin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
from cat.mad_hatter.decorators import tool, hook
from datetime import datetime
from pydantic import BaseModel
from datetime import datetime, date

class MySettings(BaseModel):
required_int: int
optional_int: int = 42
required_str: str
optional_str: str = "stocats"
required_date: date
optional_date: date = 1679616000

@hook
def plugin_settings_schema():
return MySettings.schema()

@tool
def get_the_time(tool_input, cat):
Expand Down

0 comments on commit 1b44128

Please sign in to comment.