Skip to content

Commit

Permalink
ci: run semantic-release through poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
Brice Santus committed Sep 23, 2023
1 parent bc11b52 commit e98c2e6
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 7 deletions.
30 changes: 25 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ jobs:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.ref_name }}
- uses: actions/setup-python@v4
with:
python-version: "3.10.13"
Expand All @@ -66,8 +69,25 @@ jobs:
virtualenvs-create: true
virtualenvs-in-project: false
installer-parallel: true
- name: Semantic Release
run: |
git config user.name github-actions
git config user.email [email protected]
semantic-release publish
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root

- name: Install project
run: poetry install --no-interaction

- name: Build project
run: poetry build

- name: Python Semantic Release
uses: python-semantic-release/python-semantic-release@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
PyPI_TOKEN: ${{secrets.PYPI_TOKEN}}
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@ profile = "black"
[tool.semantic_release]
version_variable = [
"euterpe/__init__.py:__version__",
"pyproject.toml:version"
]
version_toml = [
"pyproject.toml:tool.poetry.version"
]
branch = "main"
upload_to_pypi = false
upload_to_release = true
build_command = "poetry build"
build_command = "echo 'Building...'"

[build-system]
requires = ["poetry-core"]
Expand Down

0 comments on commit e98c2e6

Please sign in to comment.