Skip to content

Make pip install of source dir possible #82

Make pip install of source dir possible

Make pip install of source dir possible #82

Workflow file for this run

name: build-wheel
on:
push:
jobs:
tag:
name: Tag new version
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
new_tag: ${{ steps.tag_version.outputs.new_tag }}
changelog: ${{ steps.tag_version.outputs.changelog }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Bump version and push tag
id: tag_version
if: github.ref == 'refs/heads/master'
uses: anothrNick/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: false
DEFAULT_BUMP: patch
wheels:
name: Build wheel on ${{ matrix.python }} ${{ matrix.os }} ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
python: [cp38,cp39,cp310,cp311,cp312]
arch: [x86_64]
env:
SCCACHE_GHA_ENABLED: "on"
permissions:
contents: write
needs: tag
steps:
- uses: actions/checkout@v4
if: github.ref != 'refs/heads/master'
with:
fetch-depth: 0
- uses: actions/checkout@v4
if: github.ref == 'refs/heads/master'
with:
fetch-depth: 0
ref: ${{ needs.tag.outputs.new_tag }}
- name: Set up sccache
uses: mozilla-actions/[email protected]
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Get dakota src
run: make get-dakota-src
- uses: pypa/[email protected]
env:
CIBW_BUILD: ${{ matrix.python }}*${{ matrix.arch }}
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}-${{ matrix.python }}-${{ matrix.arch }}
path: ./wheelhouse/*.whl
release:
name: Create new github release
runs-on: ubuntu-latest
permissions:
contents: write
if: github.ref == 'refs/heads/master'
needs:
- tag
- wheels
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ needs.tag.outputs.new_tag }}
- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{ needs.tag.outputs.new_tag }}
generateReleaseNotes: true
artifacts: wheels-*
test-pypi:
name: Publish wheels on Test PyPI
runs-on: ubuntu-latest
needs:
- release
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