-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR updates our Semantic Release workflow to align with best practices and official documentation. Key changes include: 1. Simplified the workflow to use the official Python Semantic Release GitHub Action. 2. Adjusted permissions to ensure proper access for creating releases and tags. 3. Updated pyproject.toml to prevent double publishing to PyPI. These changes aim to: - Streamline our release process - Improve reliability and consistency of our versioning
- Loading branch information
Showing
2 changed files
with
11 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters