Skip to content
Open
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
21 changes: 16 additions & 5 deletions .github/workflows/check_latest_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,25 @@ jobs:

- name: Extract module name and version from release tag
id: extract_tag
shell: python
run: |
import os
import json

# Extract module name and version from the release tag
# Assuming the tag format is <module_name>-<version>, e.g., nidigital-1.4.0
TAG="${{ github.event_name == 'workflow_dispatch' && inputs.release_tag || github.event.release.tag_name }}"
MODULE_NAME=$(echo "$TAG" | cut -d'-' -f1)
MODULE_VERSION=$(echo "$TAG" | cut -d'-' -f2-)
echo "module_name=$MODULE_NAME" >> "$GITHUB_OUTPUT"
echo "module_version=$MODULE_VERSION" >> "$GITHUB_OUTPUT"
with open(os.getenv("GITHUB_EVENT_PATH"), "r", encoding="utf-8") as event_file:
event = json.load(event_file)
if os.getenv("GITHUB_EVENT_NAME") == "workflow_dispatch":
tag = event["inputs"]["release_tag"]
else:
tag = event["release"]["tag_name"]

assert tag.count("-") == 1, f"Invalid tag format: {tag}. Expected format: <module_name>-<version>"
module_name, module_version = tag.split("-")
with open(os.getenv("GITHUB_OUTPUT"), "a", encoding="utf-8") as output_file:
output_file.write(f"module_name={module_name}\n")
output_file.write(f"module_version={module_version}\n")
# NOTE: we don't upload test coverage for this
- name: run examples using PyPI uploads
uses: ./.github/actions/run_examples_using_pypi_uploads
Expand Down