change branch #15
Workflow file for this run
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
name: build-and-publish | ||
on: | ||
push: | ||
branches: [testing] | ||
tags: ['v*'] | ||
jobs: | ||
build-and-test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
pyver: [cp37, cp38, cp39, cp310, cp311, cp312] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: "true" | ||
- name: Build wheels | ||
uses: pypa/cibuildwheel@v2.16.2 | ||
env: | ||
CIBW_BUILD: ${{ matrix.pyver }}-* | ||
- name: Upload wheel artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: wheels-${{ matrix.os }}-${{ matrix.pyver }}-${{ strategy.job-index }} | ||
path: wheelhouse/* | ||
- name: Test | ||
# install the built wheels for python 3.10 | ||
run: | | ||
python -m pip install --user wheelhouse/*cp310*.whl | ||
python -m unittest discover -v -s mplib/tests | ||
build-sdist: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: "true" | ||
- name: Setup python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
- name: Install pypa/build | ||
run: "python -m pip install build --user" | ||
- name: Build a source tarball | ||
run: "python -m build --sdist" | ||
- name: Upload sdist artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: sdist | ||
path: dist/* | ||
nightly-release: | ||
if: startsWith(github.ref, 'refs/heads/') # if a commit is pushed | ||
needs: [build-and-test, build-sdist] | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write # create nightly release | ||
steps: | ||
- name: Download wheel artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: dist/ | ||
merge-multiple: true | ||
- name: Update Nightly Release | ||
uses: andelf/nightly-release@main | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: nightly | ||
name: 'Nightly Release' | ||
prerelease: true | ||
body: 'MPlib development nightly release. This release is mainly for internal testing. Stable releases are published to pypi https://pypi.org/p/mplib/' | ||
files: | | ||
dist/* | ||
publish-pypi: | ||
if: startsWith(github.ref, 'refs/tags/v') # if a tag is pushed | ||
needs: build | ||
Check failure on line 82 in .github/workflows/build_and_publish.yml GitHub Actions / build-and-publishInvalid workflow file
|
||
runs-on: ubuntu-latest | ||
environment: pypi_publish | ||
permissions: | ||
id-token: write # mandatory for PyPI trusted publishing | ||
steps: | ||
- name: Download wheel artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: dist/ | ||
merge-multiple: true | ||
- name: Publish distribution to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
packages-dir: dist/ |