-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
52 additions
and
51 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 |
---|---|---|
|
@@ -8,12 +8,11 @@ on: | |
types: [published] | ||
|
||
jobs: | ||
build: | ||
name: Build distribution 📦 | ||
build_sdist: | ||
name: Build source distribution | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
|
@@ -26,64 +25,66 @@ jobs: | |
git fetch --depth=1 origin +refs/tags/*:refs/tags/* | ||
if: github.repository_owner == 'ctlab' | ||
|
||
- name: Install pypa/build | ||
run: python3 -m pip install build --user | ||
|
||
- name: Install pypa/build | ||
run: python3 -m pip install build --user | ||
- name: Build sdist | ||
shell: bash | ||
run: | | ||
python -m pip install --upgrade pip build | ||
python -m build -s . | ||
- name: Build a binary wheel and a source tarball | ||
run: python3 -m build | ||
|
||
- name: Store the distribution packages | ||
- name: Upload sdist | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
|
||
publish-to-pypi: | ||
name: Publish distribution 📦 to PyPI | ||
if: github.repository_owner == 'ctlab' && github.event.release | ||
needs: | ||
- build | ||
name: sdist | ||
path: dist | ||
|
||
manylinux2_28: | ||
name: Build and test Linux wheels | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: publish-pypi | ||
url: https://pypi.org/p/gadma | ||
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 Test PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
publish-to-testpypi: | ||
name: Publish distribution 📦 to TestPyPI | ||
if: github.repository_owner == 'ctlab' | ||
needs: | ||
- build | ||
runs-on: ubuntu-latest | ||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
|
||
- name: Upload Wheels | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: linux-wheels | ||
path: wheelhouse | ||
|
||
manylinux2_28_test: | ||
name: Build package from source dist | ||
runs-on: ubuntu-latest | ||
needs: ['build_sdist'] | ||
strategy: | ||
matrix: | ||
python: [3.8, 3.9, "3.10"] | ||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ secrets.GITHUB_TOKEN }} | ||
pypi-publish: | ||
name: Upload to TestPyPI | ||
runs-on: ubuntu-latest | ||
needs: ['manylinux2_28', 'manylinux2_28_test'] | ||
environment: | ||
name: publish-testpypi | ||
url: https://test.pypi.org/p/gadma | ||
|
||
permissions: | ||
id-token: write # IMPORTANT: mandatory for trusted publishing | ||
|
||
id-token: write | ||
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/ | ||
- name: Download all | ||
uses: actions/[email protected] | ||
|
||
- name: Move to dist | ||
run: | | ||
mkdir dist | ||
cp */*.{whl,gz} dist/. | ||
- name: Publish distribution to TestPyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 |