Skip to content

Commit

Permalink
fix: release workflow 2 (#32)
Browse files Browse the repository at this point in the history
This PR modifies our Semantic Release workflow to ensure it's only
triggered manually:

1. Removed automatic trigger on push to main branch
2. Retained only the `workflow_dispatch` trigger
3. Simplified job structure while maintaining all necessary steps and
permissions

These changes provide more control over when releases are created,
allowing us to:
- Prevent unintended automatic releases
- Manually initiate the release process when desired
- Maintain full functionality of the Semantic Release process
  • Loading branch information
Bjarten authored Oct 18, 2024
1 parent b291782 commit ddc6493
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
name: Semantic Release
name: Create New Release

on:
push:
branches:
- main
workflow_dispatch:
workflow_dispatch: # This ensures the workflow is only triggered manually

jobs:
release:
name: Create Release
runs-on: ubuntu-latest
concurrency: release
permissions:
id-token: write
contents: write
issues: write
pull-requests: write
actions: write

steps:
- name: Checkout code
Expand All @@ -21,7 +20,6 @@ jobs:
fetch-depth: 0

- name: Python Semantic Release
id: release
uses: python-semantic-release/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "early-stopping-pytorch"
dynamic = ["version"]
description = "A PyTorch utility package for Early Stopping"
readme = "README.md"
authors = [
Expand All @@ -15,8 +16,11 @@ dependencies = [
"torch>=1.9.0"
]

[tool.setuptools.dynamic]
version = {attr = "early_stopping_pytorch.__version__"}

[tool.semantic_release]
version_variable = "early_stopping_pytorch/__init__.py:__version__"
version_variable = ["early_stopping_pytorch/__init__.py:__version__"]
branch = "main"
upload_to_pypi = false
build_command = "pip install build && python -m build"
Expand Down

0 comments on commit ddc6493

Please sign in to comment.