From f1fc132fcb72f53f3e251a81dd25c7ae0aa8df77 Mon Sep 17 00:00:00 2001 From: Werner Van Geit Date: Tue, 30 Jul 2024 11:44:57 +0200 Subject: [PATCH 1/4] Fix tagging --- .github/workflows/build-wheels.yml | 58 ++++++++++++++++++++++-------- 1 file changed, 44 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 4ae475c..3133334 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -4,6 +4,24 @@ on: push: jobs: + tag: + name: Tagging new version + runs-on: ubuntu-latest + permissions: + contents: write + if: github.ref == 'refs/heads/master' + outputs: + new_tag: ${{ steps.tag_version.outputs.new_tag}} + changelog: ${{ steps.tag_version.outputs.changelog}} + steps: + - name: Bump version and push tag + id: tag_version + uses: anothrNick/github-tag-action@1.64.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + WITH_V: false + DEFAULT_BUMP: patch + wheels: name: Building wheel on ${{ matrix.python }} ${{ matrix.os }} ${{ matrix.arch }} runs-on: ${{ matrix.os }} @@ -27,28 +45,40 @@ 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/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: Upload wheels + uses: actions/upload-artifact@v4 + with: + name: wheels-${{ matrix.os }}-${{ matrix.python }}-${{ matrix.arch }} + path: ./wheelhouse/*.whl + + release: + name: Creating new github release + runs-on: ubuntu-latest + permissions: + contents: write + if: github.ref == 'refs/heads/master' + needs: tag + 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 From 93c6c7f15fb92bbc5bb7c4e72bfbc758e9f92a29 Mon Sep 17 00:00:00 2001 From: Werner Van Geit Date: Tue, 30 Jul 2024 11:48:05 +0200 Subject: [PATCH 2/4] Add dependencies between actions --- .github/workflows/build-wheels.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 3133334..186c23c 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -35,6 +35,7 @@ jobs: SCCACHE_GHA_ENABLED: "on" permissions: contents: write + needs: tag steps: - uses: actions/checkout@v4 with: @@ -62,7 +63,9 @@ jobs: permissions: contents: write if: github.ref == 'refs/heads/master' - needs: tag + needs: + - tag + - wheels steps: - name: Download all artifacts uses: actions/download-artifact@v4 @@ -83,7 +86,7 @@ jobs: name: Publish wheels on Test PyPI runs-on: ubuntu-latest needs: - - wheels + - release if: github.ref == 'refs/heads/master' environment: name: testpypi From 6b71d86fa7c1df9747b7624c7f006eeff11e3170 Mon Sep 17 00:00:00 2001 From: Werner Van Geit Date: Tue, 30 Jul 2024 11:50:36 +0200 Subject: [PATCH 3/4] Fix dependencies --- .github/workflows/build-wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 186c23c..1ea8248 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -9,13 +9,13 @@ jobs: runs-on: ubuntu-latest permissions: contents: write - if: github.ref == 'refs/heads/master' outputs: new_tag: ${{ steps.tag_version.outputs.new_tag}} changelog: ${{ steps.tag_version.outputs.changelog}} steps: - name: Bump version and push tag id: tag_version + if: github.ref == 'refs/heads/master' uses: anothrNick/github-tag-action@1.64.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 9a3f05045ba38aed9e6e1117cbb8c2f559182585 Mon Sep 17 00:00:00 2001 From: Werner Van Geit Date: Tue, 30 Jul 2024 11:56:57 +0200 Subject: [PATCH 4/4] Pull code in github tag action --- .github/workflows/build-wheels.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 1ea8248..9dd9adf 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -5,7 +5,7 @@ on: jobs: tag: - name: Tagging new version + name: Tag new version runs-on: ubuntu-latest permissions: contents: write @@ -13,6 +13,9 @@ jobs: 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' @@ -23,12 +26,12 @@ jobs: 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: @@ -58,7 +61,7 @@ jobs: path: ./wheelhouse/*.whl release: - name: Creating new github release + name: Create new github release runs-on: ubuntu-latest permissions: contents: write