diff --git a/.github/workflows/build_assets.yml b/.github/workflows/build_assets.yml index ca757c801..53b55dc78 100644 --- a/.github/workflows/build_assets.yml +++ b/.github/workflows/build_assets.yml @@ -2,13 +2,12 @@ name: Build Compiled Assets on: - pull_request: - branches: - - main - push: - # Pattern matched against refs/tags - tags: - - 'v[0-9]+.[0-9]+.[0-9]+' + workflow_call: + inputs: + release: + type: boolean + default: false + description: "Attach artifacts to a release" jobs: build_assets: @@ -69,12 +68,12 @@ jobs: run: ${{matrix.CMD_BUILD}} - name: Upload a Build Artifact uses: actions/upload-artifact@v4 - if: github.ref_type == 'tag' + if: inputs.release == false with: name: ${{ matrix.OUT_FILE_NAME }} path: ./dist/${{ matrix.OUT_FILE_NAME }} - name: Upload Release Asset - if: github.ref_type == 'tag' + if: inputs.release == true id: upload-release-asset uses: svenstaro/upload-release-action@v2 with: @@ -119,12 +118,12 @@ jobs: ./scripts/build_${{ matrix.distro_name }}_arm.sh ${{ matrix.distro_name }}_${{ matrix.arch }} - name: Upload a Build Artifact uses: actions/upload-artifact@v4 - if: github.ref_type == 'tag' + if: inputs.release == false with: name: codecovcli_${{ matrix.distro_name }}_${{ matrix.arch }} path: ./dist/codecovcli_${{ matrix.distro_name }}_${{ matrix.arch }} - name: Upload Release Asset - if: github.ref_type == 'tag' + if: inputs.release == true id: upload-release-asset uses: svenstaro/upload-release-action@v2 with: diff --git a/.github/workflows/build_for_pypi.yml b/.github/workflows/build_for_pypi.yml index b265bbde8..49603f1b2 100644 --- a/.github/workflows/build_for_pypi.yml +++ b/.github/workflows/build_for_pypi.yml @@ -3,12 +3,13 @@ name: Build and Optionally Publish to PyPi on: pull_request: - branches: - - main - push: - # Pattern matched against refs/tags - tags: - - 'v[0-9]+.[0-9]+.[0-9]+' + branches: main + workflow_call: + inputs: + publish: + type: boolean + default: false + description: "Publish to PyPi" jobs: build_src_for_pypi: @@ -64,9 +65,8 @@ jobs: name: cibw-wheels-${{ matrix.os }} path: ./wheelhouse/*.whl - publish_to_pypi: - if: github.ref_type == 'tag' + if: inputs.publish == true || false needs: - build_dist_for_pypi - build_src_for_pypi @@ -80,7 +80,11 @@ jobs: - name: Download artifacts uses: actions/download-artifact@v4 with: + path: dist/ pattern: cibw-* + - name: Display artifacts + run: | + ls -alrt */*/* - name: Publish package to PyPi uses: pypa/gh-action-pypi-publish@release/v1 with: