Skip to content

Commit

Permalink
Merge pull request #25 from ewjoachim/change-versionning-system
Browse files Browse the repository at this point in the history
  • Loading branch information
ewjoachim authored Aug 10, 2024
2 parents 0c1791b + c139e33 commit 921dc78
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 8 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Release

on:
workflow_dispatch:
inputs:
tag:
description: "Tag to release"
required: true
type: string

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install poetry
run: pipx install poetry

- uses: actions/setup-python@v5
with:
cache: "poetry"

- run: poetry install

- run: poetry version "${{ github.event.inputs.tag }}"

- run: git commit -am "Release ${{ github.event.inputs.tag }}"
env:
GIT_AUTHOR_NAME: "GitHub Actions"
GIT_AUTHOR_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com"
GIT_COMMITTER_NAME: "GitHub Actions"
GIT_COMMITTER_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com"

- run: git push origin

- run: >
gh release create "${{ github.event.inputs.tag }}"
--title "${{ github.event.inputs.tag }}"
--generate-notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28 changes: 28 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Contributing

Contributions are welcome! The project is quite small so feel free to
familiarize yourself with the codebase and open an issue or a pull request.
Before doing anything important, feel free to open an issue to discuss it.

All interactions are required to follow the
[Code of Conduct](CODE_OF_CONDUCT.md) which sets rules for the community.

## Development

The project uses [Poetry](https://python-poetry.org/),
[pre-commit](https://pre-commit.com/), and
[pytest](https://docs.pytest.org/en/stable/).

```console
$ poetry install
$ pre-commit install
$ poetry run pytest
```

If you have any questions, feel free to ask them in the issues.

# Internal documentation

## Releasing

Launch the `Release`worfklow with the desired tag.
11 changes: 3 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[build-system]
requires = ["poetry-core", "poetry-dynamic-versioning"]
build-backend = "poetry_dynamic_versioning.backend"
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "poetry_to_pre_commit"
version = "0.0.0"
version = "2.1.0"
description = "Sync versions in .pre-commit-config.yaml from poetry.lock"
authors = ["Joachim Jablon"]
license = "MIT License"
Expand Down Expand Up @@ -41,11 +41,6 @@ pytest = "*"
pytest-cov = "*"
pytest-mock = "*"

[tool.poetry-dynamic-versioning]
enable = true
pattern = '(?P<base>\d+(\.\d+)*)([-._]?((?P<stage>[a-zA-Z]+)[-._]?(?P<revision>\d+)?))?$'
vcs = 'git'

[tool.pytest.ini_options]
addopts = [
"--cov-report=term-missing",
Expand Down

0 comments on commit 921dc78

Please sign in to comment.