Skip to content

Commit

Permalink
fix: split the pypi and asset building
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasrockhu-codecov committed Jan 26, 2025
1 parent 7440fc8 commit c21c77b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 37 deletions.
17 changes: 7 additions & 10 deletions .github/workflows/build_assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@
name: Build Compiled Assets

on:
workflow_call:
inputs:
release:
type: boolean
default: false
description: "Attach artifacts to a release"
pull_request:
branches:
- main

jobs:
build_assets:
Expand Down Expand Up @@ -68,12 +65,12 @@ jobs:
run: ${{matrix.CMD_BUILD}}
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4
if: inputs.release == false
if: startsWith(github.ref, 'refs/tags/')
with:
name: ${{ matrix.OUT_FILE_NAME }}
path: ./dist/${{ matrix.OUT_FILE_NAME }}
- name: Upload Release Asset
if: inputs.release == true
if: startsWith(github.ref, 'refs/tags/')
id: upload-release-asset
uses: svenstaro/upload-release-action@v2
with:
Expand Down Expand Up @@ -118,12 +115,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: inputs.release == false
if: startsWith(github.ref, 'refs/tags/')
with:
name: codecovcli_${{ matrix.distro_name }}_${{ matrix.arch }}
path: ./dist/codecovcli_${{ matrix.distro_name }}_${{ matrix.arch }}
- name: Upload Release Asset
if: inputs.release == true
if: startsWith(github.ref, 'refs/tags/')
id: upload-release-asset
uses: svenstaro/upload-release-action@v2
with:
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/build_for_pypi.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
name: Build and Optionally Publish to PyPi

on:
workflow_call:
inputs:
publish:
type: boolean
default: false
description: "Publish to PyPi"
pull_request:
branches:
- main

jobs:
build_dist_for_pypi:
Expand Down Expand Up @@ -77,7 +74,7 @@ jobs:
./dist/*.tar.gz
./dist/*.whl
- name: Publish package to PyPi
if: inputs.publish == true
if: startsWith(github.ref, 'refs/tags/')
uses: pypa/gh-action-pypi-publish@release/v1
with:
attestations: false
Expand Down
17 changes: 0 additions & 17 deletions .github/workflows/build_main.yml

This file was deleted.

1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ dependencies = [
"click==8.*",
"httpx==0.27.*",
"ijson==3.*",
"pathspec>=0.12.1",
"pyyaml==6.*",
"regex",
"responses==0.21.*",
Expand Down
2 changes: 0 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ idna==3.10
# requests
ijson==3.3.0
# via codecov-cli (pyproject.toml)
pathspec==0.12.1
# via codecov-cli (pyproject.toml)
pyyaml==6.0.2
# via codecov-cli (pyproject.toml)
regex==2024.11.6
Expand Down

0 comments on commit c21c77b

Please sign in to comment.