Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/auto_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Auto Release on Push

on:
push:
branches:
- main

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Generate version tag
id: tag
run: |
LATEST=""
while IFS= read -r TAG; do
if [[ "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
LATEST="$TAG"
break
fi
done < <(git for-each-ref --sort=-version:refname --format='%(refname:strip=2)' refs/tags)
if [ -z "$LATEST" ]; then
VERSION="v0.1.0"
TITLE="v0.1.0 — First production release"
else
IFS=. read -r MAJOR MINOR PATCH <<< "${LATEST#v}"
VERSION="v$MAJOR.$MINOR.$((PATCH + 1))"
TITLE="$VERSION"
fi
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "title=$TITLE" >> "$GITHUB_OUTPUT"
echo "Tagging as $VERSION"

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.tag.outputs.version }}
name: ${{ steps.tag.outputs.title }}
body: |
Automated release from push to main.
Commit: ${{ github.sha }}
Message: ${{ github.event.head_commit.message }}
draft: false
prerelease: false
8 changes: 7 additions & 1 deletion core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ def home(request):

skills_by_category = {}
for skill in Skill.objects.all():
cat_label = skill.get_category_display()
# Django generates this method dynamically, so access it defensively for
# static type checkers that cannot see generated model methods.
get_category_display = getattr(skill, 'get_category_display', None)
cat_label = (
get_category_display() if callable(get_category_display)
else str(skill.category)
)
if cat_label not in skills_by_category:
skills_by_category[cat_label] = []
skills_by_category[cat_label].append(skill)
Expand Down
Loading