Skip to content

Commit

Permalink
Try to switch to PyPi trusted publisher.
Browse files Browse the repository at this point in the history
  • Loading branch information
Holt59 committed Sep 20, 2023
1 parent a1f5ef3 commit e0c27d7
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 103 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ jobs:
deploy:
runs-on: ubuntu-latest

permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing

steps:
- uses: actions/checkout@v4
- name: Replace string
Expand All @@ -20,21 +23,18 @@ jobs:
string: ${{ github.ref_name }}
pattern: "v?([0-9][.][0-9][.][0-9]).*"
replace-with: "$1"
- name: Set up Python
uses: actions/setup-python@v2
- uses: actions/setup-python@v2
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
python-version: 3.11
- uses: abatilo/actions-poetry@v2
- name: Build
run: |
cd stubs/setup
mkdir mobase-stubs
cp -r ../${{ steps.version.outputs.replaced }}/mobase-stubs/* mobase-stubs/
sed -i 's/__version__ = ".*"/__version__ = "${{ github.ref_name }}"/' mobase-stubs/__init__.pyi
python setup.py sdist bdist_wheel
twine upload dist/*
TAG=${{ github.ref_name }}
poetry version ${TAG#v}
poetry build
- name: Publish to PyPi
uses: pypa/gh-action-pypi-publish@release/v1
21 changes: 0 additions & 21 deletions stubs/setup/LICENSE

This file was deleted.

Empty file removed stubs/setup/mobase-stubs/.keep
Empty file.
7 changes: 7 additions & 0 deletions stubs/setup/poetry.lock

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

18 changes: 18 additions & 0 deletions stubs/setup/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[tool.poetry]
name = "mobase-stubs"
version = "v2.5.0.dev12"
description = "PEP561 stub files for the mobase Python API."
authors = ["Holt59 <capelle.mikael@gmail.com>"]
license = "MIT"
readme = "README.md"
packages = [{ include = "mobase-stubs" }]
homepage = "https://www.modorganizer.org/python-plugins-doc/"
documentation = "https://www.modorganizer.org/python-plugins-doc/"
repository = "https://github.com/ModOrganizer2/mo2-pystubs-generation"

[tool.poetry.dependencies]
python = "^3.11"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
69 changes: 0 additions & 69 deletions stubs/setup/setup.py

This file was deleted.

0 comments on commit e0c27d7

Please sign in to comment.