Skip to content

Commit

Permalink
ci: fix failing release workflow
Browse files Browse the repository at this point in the history
Update the failing release workflow (GitHub Action) to enable Python
Semantic Release to automatically create a new release when the
development branch is merged into main.

- Add the GITHUB_TOKEN to the semantic release step, where it is
necessary for committing changes, using the standard syntax for
referencing secrets.
- Include the missing versioning command in the semantic release step to
ensure the new version is calculated.
- Correct the outdated syntax for referencing the version number in the
pyproject.toml file to align with the requirements of the current version
of Python Semantic Release.
  • Loading branch information
clnsmth authored Jan 17, 2024
1 parent dc80841 commit 49c986f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
token: GITHUB_TOKEN

- name: Install poetry
uses: snok/install-poetry@v1
Expand All @@ -89,9 +88,12 @@ jobs:
run: poetry install

- name: Use Python Semantic Release to prepare release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name github-actions
git config user.email github-actions@github.com
poetry run semantic-release version
poetry run semantic-release publish
git checkout development
git merge main
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ sphinx-autoapi = "^3.0.0"
pytest-mock = "^3.12.0"

[tool.semantic_release]
version_variable = "pyproject.toml:version" # version location
version_toml = ["pyproject.toml:tool.poetry.version"] # version location
branch = "main" # branch to make releases of
changelog_file = "CHANGELOG.md" # changelog file
build_command = "poetry build" # build dists
Expand Down

0 comments on commit 49c986f

Please sign in to comment.