Merge pull request #15 from ITISFoundation/setuptools_scm #101
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-wheel | |
on: | |
push: | |
jobs: | |
wheels: | |
name: Building wheel on ${{ matrix.python }} ${{ matrix.os }} ${{ matrix.arch }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: true | |
matrix: | |
os: [ubuntu-20.04] | |
python: [cp38,cp39,cp310,cp311,cp312] | |
arch: [x86_64] | |
env: | |
SCCACHE_GHA_ENABLED: "on" | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up sccache | |
uses: mozilla-actions/sccache-action@v0.0.5 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
- name: Bump version and push tag | |
if: ${{ github.ref == 'refs/heads/master' }} | |
id: tag_version | |
uses: anothrNick/github-tag-action@1.64.0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
WITH_V: false | |
DEFAULT_BUMP: patch | |
- name: Get dakota src | |
run: make get-dakota-src | |
- uses: pypa/cibuildwheel@v2.16 | |
env: | |
CIBW_BUILD: ${{ matrix.python }}*${{ matrix.arch }} | |
- name: Create a GitHub release | |
if: ${{ github.ref == 'refs/heads/master' }} | |
uses: ncipollo/release-action@v1 | |
with: | |
tag: ${{ steps.tag_version.outputs.new_tag }} | |
name: Release ${{ steps.tag_version.outputs.new_tag }} | |
body: ${{ steps.tag_version.outputs.changelog }} | |
artifacts: ./wheelhouse/*.whl | |
test-pypi: | |
name: Publish wheels on Test PyPI | |
runs-on: ubuntu-latest | |
needs: | |
- wheels | |
if: github.ref == 'refs/heads/master' | |
environment: | |
name: testpypi | |
url: https://test.pypi.org/p/itis-dakota | |
permissions: | |
id-token: write | |
steps: | |
- name: Download all artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: wheels-* | |
path: dist | |
merge-multiple: true | |
- name: Publish package to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
repository-url: https://test.pypi.org/legacy/ | |
pypi: | |
name: Publish wheels on PyPI | |
runs-on: ubuntu-latest | |
needs: | |
- test-pypi | |
if: github.ref == 'refs/heads/master' | |
environment: | |
name: pypi | |
url: https://pypi.org/p/itis-dakota | |
permissions: | |
id-token: write | |
steps: | |
- name: Download all artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: wheels-* | |
path: dist | |
merge-multiple: true | |
- name: Publish package to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |