Skip to content

fix: release workflow #31

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

Merged
merged 11 commits into from
Oct 18, 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
48 changes: 10 additions & 38 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,27 @@
name: Create New Release
name: Semantic Release

on:
push:
branches:
- main
workflow_dispatch:
inputs:
dry-run:
description: |
Perform a dry run release (check for testing, uncheck for real release)
- Checked (true): Simulates the release process without making changes
- Unchecked (false): Creates an actual release with version bump
Note: Ensure all desired changes are merged to main before releasing
required: true
default: true
type: boolean

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

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

- name: Set up Python
uses: actions/setup-python@v4
- name: Python Semantic Release
id: release
uses: python-semantic-release/python-semantic-release@v9.12.0
with:
python-version: '3.12'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install python-semantic-release

- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

- name: Run semantic-release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [ "${{ github.event.inputs.dry-run }}" = "true" ]; then
semantic-release publish --dry-run --verbose
else
semantic-release publish --verbose
fi
github_token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ upload_to_pypi = false
build_command = "pip install build && python -m build"

[tool.semantic_release.git]
tag_format = "v{version}"
tag_format = "v{version}"