Skip to content

Commit

Permalink
feat: semantic release automation
Browse files Browse the repository at this point in the history
  • Loading branch information
d0choa committed Dec 2, 2023
1 parent a6cc21d commit 005671a
Show file tree
Hide file tree
Showing 5 changed files with 131 additions and 8 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Semantic Release

on:
push:
branches:
- master

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

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.OTG_ETL_RELEASE }}

- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install poetry --upgrade pip
poetry config virtualenvs.create false
poetry install
- name: Python Semantic Release
run: |
git config --global user.name "github-actions"
git config --global user.email "action@github.com"
semantic-release publish -D commit_author="github-actions <action@github.com>"
env:
GH_TOKEN: ${{secrets.OTG_ETL_RELEASE}}
# PyPI_TOKEN: ${{secrets.PyPI_TOKEN}}
84 changes: 83 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 5 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "otgenetics"
version = "1.0.0"
version = "0.0.1"
description = "Open targets Genetics Portal Python ETL"
authors = ["Open Targets core team"]
license = "Apache License v2"
Expand Down Expand Up @@ -64,17 +64,16 @@ google-cloud-dataproc = "^5.7.0"
apache-airflow = "^2.7.3"
apache-airflow-providers-google = "^10.11.1"
pydoclint = "^0.3.8"

python-semantic-release = "^8.3.0"

[tool.semantic_release]
branch = "main"
version_variable = "src/otg/__init__.py:__version__"
version_variable = ["src/otg/__init__.py:__version__"]
version_toml = ["pyproject.toml:tool.poetry.version"]
version_source = "tag"
commit_version_number = true # required for version_source = "tag"
tag_commit = true
major_on_zero = true
upload_to_pypi = false
upload_to_release = false
build_command = "pip install poetry && poetry build"

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down
2 changes: 2 additions & 0 deletions src/otg/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Modules supporting Genetics Portal analysis."""

from __future__ import annotations

__version__ = "0.0.1"
2 changes: 1 addition & 1 deletion tests/test_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
def mkdocs_build() -> None:
"""Fixture to build documentation."""
try:
cfg = load_config("mkdocs.yml", strict=False)
cfg = load_config("mkdocs.yml", strict=True)
cfg.plugins["material/search"].on_startup(command="build", dirty=not "clean")
# config = load_config()
# config.strict = True
Expand Down

0 comments on commit 005671a

Please sign in to comment.