Skip to content

Commit

Permalink
Create automatic version tagging action
Browse files Browse the repository at this point in the history
Erase invalid import
  • Loading branch information
tooruu committed Mar 8, 2024
1 parent e5f6592 commit 3440315
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 4 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Tag new version

on:
push:
branches:
- main

env:
VERSION_PATH: arabot/__init__.py
VERSION_REGEX: '^\+__version__ = "(.+)"$'

jobs:
tag:
name: Autotag
runs-on: ubuntu-latest
steps:
- name: Checkout commit
uses: actions/checkout@v4
with:
sparse-checkout: ${{ env.VERSION_PATH }}
sparse-checkout-cone-mode: false
fetch-depth: 0

- name: Set credentials
run: |
git config user.name github-actions
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Tag commit
id: tag
run: |
LAST_TAG=$(git describe --abbrev=0)
VERSION=$(git diff "$LAST_TAG" HEAD "$VERSION_PATH" | sed -nr "s/$VERSION_REGEX/\1/p")
[ "$VERSION" ] && git tag -m "v$VERSION" "$VERSION"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Push tag
if: steps.tag.outputs.version
run: git push --tags
2 changes: 1 addition & 1 deletion arabot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from dotenv import load_dotenv

__version__ = "8.19.6"
__version__ = "8.19.7"

load_dotenv()
TESTING = bool(getenv("TESTING"))
Expand Down
3 changes: 1 addition & 2 deletions arabot/modules/eval/abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ class Evaluator(Protocol):
TB_FILENAME = "<repl>"

@abstractmethod
async def run(self, code: str, *args, **kwargs) -> tuple[str, Any]:
...
async def run(self, code: str, *args, **kwargs) -> tuple[str, Any]: ...
1 change: 0 additions & 1 deletion arabot/modules/google/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from aiohttp import ClientSession
from disnake import Embed
from disnake.ext.commands import command
from distutils import bcppcompiler

from arabot.core import Category, Cog, Context

Expand Down

0 comments on commit 3440315

Please sign in to comment.