Fix statically.io CDN URLs to avoid mixed-content redirect #19
This file contains hidden or 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: numflow.py CI | |
| on: | |
| push: | |
| branches: [release, main] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository }} | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: "recursive" | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: 3.11 | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pytest pytest-cov | |
| - name: Build numflow.py package | |
| run: | | |
| pip install . | |
| pip install numpy | |
| - name: Test with pytest | |
| run: | | |
| pytest ./tests/* --cov=numflow | |
| - name: Upload to Coveralls | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }} | |
| run: | | |
| pip install coveralls | |
| coveralls | |
| make-wheels: | |
| name: Make ${{ matrix.os }} wheels | |
| if: github.event_name == 'push' && contains(github.ref, 'release') | |
| needs: test | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: ["macos-latest", "ubuntu-latest", "windows-latest"] | |
| steps: | |
| - name: "Checkout repo" | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: "recursive" | |
| - name: "Build wheels" | |
| uses: pypa/cibuildwheel@v2.9.0 | |
| - name: Verify clean directory | |
| run: git diff --exit-code | |
| shell: bash | |
| - name: "Upload wheel as artifact" | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: artifact-${{ matrix.os }}-wheel | |
| path: ./wheelhouse/*.whl | |
| make-sdist: | |
| name: Make source distribution | |
| if: github.event_name == 'push' && contains(github.ref, 'release') | |
| needs: test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: "recursive" | |
| - name: Build SDist | |
| run: pipx run build --sdist | |
| - name: Check metadata | |
| run: pipx run twine check dist/* | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: artifact-source-dist | |
| path: dist/*.tar.gz | |
| tag-and-release: | |
| name: Tag commit and create a release | |
| needs: [make-wheels, make-sdist] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: "recursive" | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: 3.11 | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install scikit-build | |
| - name: "Get release version" | |
| run: | | |
| CURRENT_VERSION=$(python3 setup.py --version | tail -1) | |
| echo "Current version: $CURRENT_VERSION" | |
| echo "CURRENT_VERSION=v$CURRENT_VERSION" >> $GITHUB_ENV | |
| - uses: rickstaa/action-create-tag@v1 | |
| with: | |
| tag: ${{ env.CURRENT_VERSION }} | |
| - uses: ncipollo/release-action@v1 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| generateReleaseNotes: true | |
| tag: ${{ env.CURRENT_VERSION }} | |
| upload: | |
| name: Upload to PyPI | |
| needs: tag-and-release | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/numflow | |
| permissions: | |
| id-token: write | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: dist | |
| - name: Copy artifacts to dist/ folder | |
| run: | | |
| echo "* Downloaded artifacts:" | |
| ls dist/ | |
| cd dist/ | |
| echo "* Copying artifacts to dist/ folder:" | |
| find . -mindepth 2 -maxdepth 2 -type f -print -exec mv {} . \; | |
| echo "* Deleting empty directories:" | |
| find . -maxdepth 1 -type d -empty -print -exec rmdir {} + | |
| cd .. | |
| echo "* Prepared artifacts:" | |
| ls dist/ | |
| - name: Publish package distributions to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.PYPI_TOKEN }} |