-
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
51 additions
and
34 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,8 +8,8 @@ on: | |
types: [published] | ||
|
||
jobs: | ||
build_sdist: | ||
name: Build source distribution | ||
build: | ||
name: Build distribution 📦 | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
@@ -26,47 +26,64 @@ jobs: | |
git fetch --depth=1 origin +refs/tags/*:refs/tags/* | ||
if: github.repository_owner == 'ctlab' | ||
|
||
- name: Build sdist | ||
shell: bash | ||
run: | | ||
python -m pip install --upgrade pip build | ||
python -m build -s . | ||
- name: Install pypa/build | ||
run: python3 -m pip install build --user | ||
|
||
- name: Install pypa/build | ||
run: python3 -m pip install build --user | ||
|
||
- name: Upload sdist | ||
- 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: sdist | ||
path: dist | ||
name: python-package-distributions | ||
path: dist/ | ||
|
||
manylinux2_28_test: | ||
name: Build package from source dist | ||
publish-to-pypi: | ||
name: Publish distribution 📦 to PyPI | ||
if: github.repository_owner == 'ctlab' && github.event.release | ||
needs: | ||
- build | ||
runs-on: ubuntu-latest | ||
needs: ['build_sdist'] | ||
strategy: | ||
matrix: | ||
python: [3.8, 3.9, "3.10"] | ||
environment: | ||
name: publish-pypi | ||
url: https://pypi.org/p/gadma | ||
permissions: | ||
id-token: write # IMPORTANT: mandatory for trusted publishing | ||
|
||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ secrets.GITHUB_TOKEN }} | ||
pypi-publish: | ||
name: Upload to TestPyPI | ||
- 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 | ||
|
||
publish-to-testpypi: | ||
name: Publish distribution 📦 to TestPyPI | ||
if: github.repository_owner == 'ctlab' | ||
needs: | ||
- build | ||
runs-on: ubuntu-latest | ||
needs: ['manylinux2_28_test'] | ||
|
||
environment: | ||
name: publish-testpypi | ||
url: https://test.pypi.org/p/gadma | ||
|
||
permissions: | ||
id-token: write | ||
id-token: write # IMPORTANT: mandatory for trusted publishing | ||
|
||
steps: | ||
- 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 | ||
- 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/ |