Skip to content

Commit

Permalink
Merge pull request #27 from guanhuaw/feature/bump3
Browse files Browse the repository at this point in the history
fix pypi destination
  • Loading branch information
guanhuaw authored Aug 4, 2024
2 parents 380c34f + b50a4d4 commit 7d9da72
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/python-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI
name: Publish Python 🐍 distribution 📦 to PyPI

on:
pull_request:
Expand Down Expand Up @@ -41,7 +41,7 @@ jobs:
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/<package-name> # Replace <package-name> with your PyPI project name
url: https://pypi.org/p/mirtorch # Replace <package-name> with your PyPI project name
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

Expand Down
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 7d9da72

Please sign in to comment.