Skip to content

fix: get_dd_identifiers keyword search with tokenization and ranking #93

fix: get_dd_identifiers keyword search with tokenization and ranking

fix: get_dd_identifiers keyword search with tokenization and ranking #93

Workflow file for this run

name: Release
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
on:
push:
tags:
- "v*"
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
release:
runs-on: ubuntu-latest
# Only run on the main repository, not forks
if: github.repository == 'iterorganization/imas-codex'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python
run: uv python install 3.12
- name: Install dependencies
run: uv sync --locked --no-dev
- name: Verify hatch version matches tag
run: |
RAW=${GITHUB_REF_NAME#v}
EXPECTED=$(uv run python -c "from packaging.version import Version; print(Version('$RAW'))")
ACTUAL=$(uv run python -c "import importlib.metadata as m; print(m.version('imas-codex'))")
echo "Expected: $EXPECTED Actual: $ACTUAL"
if [ "$EXPECTED" != "$ACTUAL" ]; then
echo "Version mismatch; aborting release."; exit 1;
fi
- name: Build package
run: uv build
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
uv tool install twine
uv tool run twine upload --skip-existing dist/*
- name: Generate changelog
id: changelog
run: |
# Get the tag name
TAG_NAME=${GITHUB_REF#refs/tags/}
# Generate changelog from commits since last tag (limit to 200 commits)
if git describe --tags --abbrev=0 HEAD^ >/dev/null 2>&1; then
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^)
TOTAL=$(git rev-list --count ${PREV_TAG}..HEAD)
CHANGELOG=$(git log --pretty=format:"- %s" -200 ${PREV_TAG}..HEAD)
else
TOTAL=$(git rev-list --count HEAD)
CHANGELOG=$(git log --pretty=format:"- %s" -200)
fi
# Create release notes (stay under GitHub's 125K body limit)
{
echo "## What's Changed"
echo ""
if [ "${TOTAL:-0}" -gt 200 ]; then
echo "*Showing 200 of ${TOTAL} commits. See full changelog link below.*"
echo ""
fi
echo "${CHANGELOG}"
echo ""
echo "**Full Changelog**: https://github.com/${{ github.repository }}/compare/${PREV_TAG:-$(git rev-list --max-parents=0 HEAD)}...${TAG_NAME}"
} > release_notes.md
echo "tag_name=${TAG_NAME}" >> $GITHUB_OUTPUT
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.changelog.outputs.tag_name }}
name: Release ${{ steps.changelog.outputs.tag_name }}
body_path: release_notes.md
draft: false
prerelease: ${{ contains(steps.changelog.outputs.tag_name, '-') }}
files: |
dist/*.whl
dist/*.tar.gz