Skip to content

Commit 224573e

Browse files
committed
fix: complete semantic-release workflow with yq-free build process (#100)
* 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 * fix: add .nojekyll to disable Jekyll processing for GitHub Pages GitHub Pages was attempting to build the site with Jekyll instead of using the MkDocs-generated static files, causing deployment failures. The .nojekyll file tells GitHub Pages to serve the pre-built static files directly. * fix: remove broken src/orb symlink directory The src/orb directory contained broken symlinks that were causing Jekyll to fail when trying to process documentation. This directory appears to be an obsolete compatibility layer that's no longer needed. * fix: add semantic-release-build target for yq-free builds - Add semantic-release-build target that bypasses yq-dependent steps - Update pyproject.toml to use make semantic-release-build instead of make build - The new target directly calls build.sh without generate-pyproject or get-version - Semantic-release provides VERSION env var and handles pyproject.toml version updates Fixes semantic-release build failures due to missing yq dependency in GitHub Actions.
1 parent 68b316e commit 224573e

File tree

15 files changed

+44
-111
lines changed

15 files changed

+44
-111
lines changed

.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 }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ security-report.md
3737
*-sbom-*.json
3838
*-sbom-*.spdx
3939
*-sbom-*.cyclonedx
40+
sbom-vulnerabilities.json
4041

4142
# Python
4243
__pycache__/

.nojekyll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

:wq!

Lines changed: 0 additions & 33 deletions
This file was deleted.

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

makefiles/deploy.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ build: clean dev-install ## Build package
6565
VERSION=$${VERSION:-$$(make -s get-version)} $(MAKE) generate-pyproject && \
6666
VERSION=$${VERSION:-$$(make -s get-version)} BUILD_ARGS="$(BUILD_ARGS)" ./dev-tools/package/build.sh
6767

68+
semantic-release-build: ## Build package for semantic-release (minimal dependencies)
69+
./dev-tools/package/build.sh
70+
6871
build-test: build ## Build and test package installation
6972
@echo "Testing package installation..."
7073
make test-install

pyproject.toml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ ci = [
110110
"cyclonedx-bom>=4.0.0,<8.0.0",
111111
# Security override for safety's vulnerable peewee dependency
112112
"peewee>=3.18.3",
113+
# Security override for safety's vulnerable marshmallow dependency (CVE-2025-68480)
114+
"marshmallow>=4.1.2",
113115

114116
# Documentation
115117
"mkdocs>=1.5.0,<2.0.0",
@@ -285,8 +287,9 @@ explicit_package_bases = true
285287
namespace_packages = true
286288

287289
[tool.semantic_release]
288-
version_variables = [".project.yml:project.version"]
289-
build_command = "make build"
290+
version_toml = ["pyproject.toml:project.version"]
291+
version_variables = [".project.yml:version"]
292+
build_command = "make semantic-release-build"
290293
major_on_zero = true
291294
allow_zero_version = true
292295
tag_format = "v{version}"
@@ -307,8 +310,20 @@ match = "fix/.*|feature/.*"
307310
prerelease_token = "alpha"
308311
prerelease = true
309312

313+
[tool.semantic_release.changelog]
314+
exclude_commit_patterns = [
315+
'''chore(?:\([^)]*?\))?:.+''',
316+
'''ci(?:\([^)]*?\))?:.+''',
317+
'''refactor(?:\([^)]*?\))?:.+''',
318+
'''style(?:\([^)]*?\))?:.+''',
319+
'''test(?:\([^)]*?\))?:.+''',
320+
'''build\((?!deps\):.+)''',
321+
'''Initial [Cc]ommit.*''',
322+
]
323+
310324
[tool.semantic_release.changelog.default_templates]
311325
changelog_file = "CHANGELOG.md"
326+
output_format = "md"
312327

313328
[tool.semantic_release.commit_parser_options]
314329
minor_tags = ["feat"]

src/orb/__init__.py

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/orb/api

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/orb/application

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)