Skip to content

Commit c06db93

Browse files
committed
fix: complete semantic-release workflow with asset uploads and yq fallbacks
- Add fallback values for yq-dependent variables in makefiles/common.mk to prevent errors in containers without yq - Fix changelog configuration with proper exclude patterns and template structure - Replace manual semantic-release setup with official GitHub Actions for better reliability - Add python-semantic-release/publish-action to upload wheel and tarball assets to GitHub releases - Ensure dist files are properly uploaded to releases for distribution Fixes semantic-release workflow failures due to missing yq dependency and missing release assets.
1 parent 68b316e commit c06db93

3 files changed

Lines changed: 34 additions & 41 deletions

File tree

.github/workflows/semantic-release.yml

Lines changed: 12 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -42,36 +42,17 @@ jobs:
4242
fetch-depth: 0
4343
token: ${{ secrets.GITHUB_TOKEN }}
4444

45-
- name: Setup Python and UV
46-
uses: ./.github/actions/setup-python-uv
45+
- name: Python Semantic Release
46+
id: release
47+
uses: python-semantic-release/python-semantic-release@v10.5.3
4748
with:
48-
python-version: '3.11'
49-
50-
- name: Install semantic-release
51-
run: |
52-
source .venv/bin/activate
53-
pip install python-semantic-release
54-
55-
- name: Run semantic release
56-
env:
57-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58-
RELEASE_MODE: ${{ inputs.mode || 'forward' }}
59-
RELEASE_COMMIT: ${{ inputs.commit }}
60-
RELEASE_VERSION: ${{ inputs.version }}
61-
run: |
62-
source .venv/bin/activate
49+
github_token: ${{ secrets.GITHUB_TOKEN }}
50+
git_committer_name: "github-actions[bot]"
51+
git_committer_email: "github-actions[bot]@users.noreply.github.com"
6352

64-
if [ "${{ inputs.mode }}" = "historical" ]; then
65-
if [ -z "${{ inputs.commit }}" ] || [ -z "${{ inputs.version }}" ]; then
66-
echo "ERROR: Historical releases require both commit and version"
67-
exit 1
68-
fi
69-
echo "Creating historical release ${{ inputs.version }} from commit ${{ inputs.commit }}"
70-
RELEASE_MODE=historical RELEASE_COMMIT=${{ inputs.commit }} RELEASE_VERSION=${{ inputs.version }} semantic-release version
71-
elif [ "${{ inputs.mode }}" = "analysis" ]; then
72-
echo "Running release analysis"
73-
RELEASE_MODE=analysis ./dev-tools/release/analyze_rc_readiness.sh
74-
else
75-
echo "Running forward release with semantic-release"
76-
semantic-release version
77-
fi
53+
- name: Publish to GitHub Release Assets
54+
uses: python-semantic-release/publish-action@v10.5.3
55+
if: steps.release.outputs.released == 'true'
56+
with:
57+
github_token: ${{ secrets.GITHUB_TOKEN }}
58+
tag: ${{ steps.release.outputs.tag }}

makefiles/common.mk

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,21 @@ TEST_ARGS ?=
1414
BUILD_ARGS ?=
1515
DOCS_ARGS ?=
1616

17-
# Python version settings (loaded from project config)
18-
PYTHON_VERSIONS := $(shell yq '.python.versions | join(" ")' $(PROJECT_CONFIG))
19-
DEFAULT_PYTHON_VERSION := $(shell yq '.python.default_version' $(PROJECT_CONFIG))
17+
# Python version settings (loaded from project config, with fallbacks)
18+
PYTHON_VERSIONS := $(shell yq '.python.versions | join(" ")' $(PROJECT_CONFIG) 2>/dev/null || echo "3.10 3.11 3.12 3.13")
19+
DEFAULT_PYTHON_VERSION := $(shell yq '.python.default_version' $(PROJECT_CONFIG) 2>/dev/null || echo "3.12")
2020

2121
# Package information (loaded from project config, but respect environment VERSION for CI)
22-
PACKAGE_NAME := $(shell yq '.project.name' $(PROJECT_CONFIG))
23-
PACKAGE_NAME_SHORT := $(shell yq '.project.short_name' $(PROJECT_CONFIG))
24-
VERSION ?= $(shell yq '.project.version' $(PROJECT_CONFIG))
25-
AUTHOR := $(shell yq '.project.author' $(PROJECT_CONFIG))
26-
LICENSE := $(shell yq '.project.license' $(PROJECT_CONFIG))
22+
PACKAGE_NAME := $(shell yq '.project.name' $(PROJECT_CONFIG) 2>/dev/null || echo "open-resource-broker")
23+
PACKAGE_NAME_SHORT := $(shell yq '.project.short_name' $(PROJECT_CONFIG) 2>/dev/null || echo "orb")
24+
VERSION ?= $(shell yq '.project.version' $(PROJECT_CONFIG) 2>/dev/null || echo "0.0.0")
25+
AUTHOR := $(shell yq '.project.author' $(PROJECT_CONFIG) 2>/dev/null || echo "AWS Labs")
26+
LICENSE := $(shell yq '.project.license' $(PROJECT_CONFIG) 2>/dev/null || echo "Apache-2.0")
2727

2828
# Repository information (loaded from project config)
29-
REPO_ORG := $(shell yq '.repository.org' $(PROJECT_CONFIG))
29+
REPO_ORG := $(shell yq '.repository.org' $(PROJECT_CONFIG) 2>/dev/null || echo "awslabs")
3030
REPO_URL := https://github.com/$(REPO_ORG)/$(PACKAGE_NAME)
31-
CONTAINER_REGISTRY := $(shell yq '.repository.registry' $(PROJECT_CONFIG))/$(REPO_ORG)
31+
CONTAINER_REGISTRY := $(shell yq '.repository.registry' $(PROJECT_CONFIG) 2>/dev/null || echo "ghcr.io")/$(REPO_ORG)
3232
CONTAINER_IMAGE := $(PACKAGE_NAME)
3333
DOCS_URL := https://$(REPO_ORG).github.io/$(PACKAGE_NAME)
3434

pyproject.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,20 @@ match = "fix/.*|feature/.*"
307307
prerelease_token = "alpha"
308308
prerelease = true
309309

310+
[tool.semantic_release.changelog]
311+
exclude_commit_patterns = [
312+
'''chore(?:\([^)]*?\))?:.+''',
313+
'''ci(?:\([^)]*?\))?:.+''',
314+
'''refactor(?:\([^)]*?\))?:.+''',
315+
'''style(?:\([^)]*?\))?:.+''',
316+
'''test(?:\([^)]*?\))?:.+''',
317+
'''build\((?!deps\):.+)''',
318+
'''Initial [Cc]ommit.*''',
319+
]
320+
310321
[tool.semantic_release.changelog.default_templates]
311322
changelog_file = "CHANGELOG.md"
323+
output_format = "md"
312324

313325
[tool.semantic_release.commit_parser_options]
314326
minor_tags = ["feat"]

0 commit comments

Comments
 (0)