Skip to content

Commit

Permalink
semantic release
Browse files Browse the repository at this point in the history
  • Loading branch information
guanhuaw committed Aug 4, 2024
1 parent 4e27597 commit b50a4d4
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 12 deletions.
51 changes: 41 additions & 10 deletions .github/workflows/python-release.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,57 @@
name: Semantic Release

on:
push:
branches:
- master
pull_request:
branches:
- master

workflow_dispatch:

jobs:
release:
name: Semantic Release
runs-on: ubuntu-latest
concurrency: release
permissions:
id-token: write
contents: write
issues: write
pull-requests: write
id-token: write

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

- name: Python Semantic Release
uses: python-semantic-release/python-semantic-release@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
fetch-tags: true

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install python-semantic-release build
- name: Install project dependencies
run: |
pip install -e .
# or if you use poetry:
# pip install poetry && poetry install
- name: Semantic Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name github-actions
git config user.email github-actions@github.com
semantic-release publish
- name: Python Semantic Release
uses: python-semantic-release/python-semantic-release
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ exclude = [
"venv",
".git",
]

[tool.semantic_release]
version_variables = ["setup.py:__version__"]
upload_to_pypi = true
version_variable = ["pyproject.toml:project.version"]
branch = "master"
upload_to_pypi = false
build_command = "python -m build"

0 comments on commit b50a4d4

Please sign in to comment.