Merge pull request #86 from mikedh/master #23
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: Release To Pypi | ||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| jobs: | ||
| build_wheels: | ||
| name: Build wheel on ${{matrix.platform}} | ||
| runs-on: ${{matrix.platform}} | ||
| strategy: | ||
| matrix: | ||
| platform: [ubuntu-latest, macos-latest, windows-latest, macos-13] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Build wheels | ||
| uses: pypa/cibuildwheel@v2.22.0 | ||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| path: ./wheelhouse/*.whl | ||
| name: wheels-${{ matrix.platform }} | ||
| upload_pypi: | ||
| name: Release To PyPi | ||
| needs: [build_wheels] | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| id-token: write | ||
| steps: | ||
| - uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: "3.12" | ||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| path: dist | ||
| pattern: wheels-* | ||
| merge-multiple: true | ||
| - uses: pypa/gh-action-pypi-publish@v1.8.10 | ||
| with: | ||
| password: ${{ secrets.PYPI_API_TOKEN }} | ||
| create_release: | ||
| name: Create GitHub Release | ||
| runs-on: ubuntu-latest | ||
| needs: [build_wheels] | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 2 | ||
| - name: Tag Version | ||
| id: set_tag | ||
| run: | | ||
| export VER=v$(python -c "exec(open('src/fcl/version.py','r').read());print(__version__)") | ||
| echo "tag_name=${VER}" >> $GITHUB_OUTPUT | ||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| path: dist | ||
| pattern: wheels-* | ||
| merge-multiple: true | ||
| - uses: ncipollo/release-action@v1.14.0 | ||
| with: | ||
| artifacts: "dist/*" | ||
| tag: ${{ steps.set_tag.outputs.tag_name }} | ||