Skip to content

Commit

Permalink
move pypi push to deploy and dev_deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
erexer committed Mar 5, 2025
1 parent f8d28b7 commit c1e3a78
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 122 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/02_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,47 @@ jobs:
directory: landing/build
force: true
github_token: ${{ secrets.GITHUB_TOKEN }}
build-distribution:
name: Build distribution
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10.x"
- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
name: >-
Publish Python distribution to PyPI
needs:
- build-distribution
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/msdbook
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
49 changes: 49 additions & 0 deletions .github/workflows/03_dev_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,52 @@ jobs:
directory: deploy
force: true
github_token: ${{ secrets.GITHUB_TOKEN }}

build-distribution:
name: Build distribution
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10.x"
- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/

publish-to-testpypi:
name: Publish to TestPyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to test PyPI on tag pushes
needs:
- build-distribution
runs-on: ubuntu-latest

environment:
name: testpypi
url: https://test.pypi.org/p/msdbook

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

steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
122 changes: 0 additions & 122 deletions .github/workflows/04_publish-to-pypi.yml

This file was deleted.

0 comments on commit c1e3a78

Please sign in to comment.