Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tagging #16

Merged
merged 6 commits into from
Jul 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 53 additions & 17 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,41 @@ 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: Building wheel on ${{ matrix.python }} ${{ matrix.os }} ${{ matrix.arch }}
name: Build wheel on ${{ matrix.python }} ${{ matrix.os }} ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-20.04]
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
with:
Expand All @@ -27,33 +49,47 @@ jobs:
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/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: false
DEFAULT_BUMP: patch
- 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:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
pattern: wheels-*
path: dist
merge-multiple: true
- 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

tag: ${{ needs.tag.new_tag }}
name: ${{ needs.tag.new_tag }}
body: ${{ needs.tag.changelog }}
artifacts: wheels-*


test-pypi:
name: Publish wheels on Test PyPI
runs-on: ubuntu-latest
needs:
- wheels
- release
if: github.ref == 'refs/heads/master'
environment:
name: testpypi
Expand Down
Loading