Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add release workflow #4

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Release

on: [workflow_dispatch]

jobs:
release:
runs-on: ubuntu-latest
concurrency: release
permissions:
id-token: write
contents: write

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Python Semantic Release
uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Install dependencies
run: |
pip install -e .[dev]

- name: Run Semantic Release
run: make release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@ format: ## Format code automatically
isort: ## Sort imports. This target is not mandatory because the output may be incompatible with black formatting. Provided for convenience purposes.
isort --skip=templates ${SRC_DIRS}

release: ## release a new version
@echo "Releasing a new version."
@echo "This is a remote release, it will push to the remote repository."
semantic-release -vv version --changelog --push --tag --commit

local-release:
@echo "Releasing a new version."
@echo "This is a local release, it will not push to the remote repository."
@echo "You can push the changes and release manually."
semantic-release -vv version --changelog --commit --no-push

ESCAPE = 
help: ## Print this help
@grep -E '^([a-zA-Z_-]+:.*?## .*|######* .+)$$' Makefile \
Expand Down
73 changes: 73 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
[build-system]
requires = ["setuptools>=42", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "tutor-contrib-celery"
dynamic = ["version"]
description = "A Tutor plugin to manage our opinionated Open edX operations"
readme = "README.md"
requires-python = ">=3.8"
license = { text = "AGPLv3" }
authors = [
{ name = "eduNEXT" }
]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Affero General Public License v3",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dependencies = [
"tutor>=18.0.0,<19.0.0"
]

optional-dependencies = { dev = ["python-semantic-release", "pylint", "black"]}

[project.urls]
Homepage = "https://github.com/edunext/tutor-contrib-celery"
Code = "https://github.com/edunext/tutor-contrib-celery"
"Issue tracker" = "https://github.com/edunext/tutor-contrib-celery/issues"

[tool.setuptools.packages.find]
where = ["."]
exclude = ["tests*"]

[project.entry-points."tutor.plugin.v1"]
celery = "tutorcelery.plugin"

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

[tool.wheel]
universal = true

[tool.semantic_release]
commit_message = "chore(release): preparing {version}"
version_variables = [
"tutorcelery/__about__.py:__version__",
]

[tool.semantic_release.branches.main]
match = "(main|master)"
prerelease_token = "rc"
prerelease = false

[tool.semantic_release.changelog.environment]
keep_trailing_newline = true

[tool.semantic_release.changelog]
exclude_commit_patterns = [
"docs:",
"build:",
"style:",
"chore:",
"test:",
"ci:",
]
68 changes: 0 additions & 68 deletions setup.py

This file was deleted.

Loading