Skip to content
This repository was archived by the owner on Jul 16, 2025. It is now read-only.

Commit 764bbb8

Browse files
fix: add workflow and pypi test job
1 parent 2ebbb6c commit 764bbb8

File tree

2 files changed

+33
-18
lines changed

2 files changed

+33
-18
lines changed

.github/workflows/build_assets.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22
name: Build Compiled Assets
33

44
on:
5-
pull_request:
6-
branches:
7-
- main
8-
push:
9-
# Pattern matched against refs/tags
10-
tags:
11-
- 'v[0-9]+.[0-9]+.[0-9]+'
5+
workflow_call:
6+
inputs:
7+
release:
8+
type: boolean
9+
default: false
10+
description: "Attach artifacts to a release"
1211

1312
jobs:
1413
build_assets:
@@ -69,12 +68,12 @@ jobs:
6968
run: ${{matrix.CMD_BUILD}}
7069
- name: Upload a Build Artifact
7170
uses: actions/upload-artifact@v4
72-
if: github.ref_type == 'tag'
71+
if: inputs.release == false
7372
with:
7473
name: ${{ matrix.OUT_FILE_NAME }}
7574
path: ./dist/${{ matrix.OUT_FILE_NAME }}
7675
- name: Upload Release Asset
77-
if: github.ref_type == 'tag'
76+
if: inputs.release == true
7877
id: upload-release-asset
7978
uses: svenstaro/upload-release-action@v2
8079
with:
@@ -119,12 +118,12 @@ jobs:
119118
./scripts/build_${{ matrix.distro_name }}_arm.sh ${{ matrix.distro_name }}_${{ matrix.arch }}
120119
- name: Upload a Build Artifact
121120
uses: actions/upload-artifact@v4
122-
if: github.ref_type == 'tag'
121+
if: inputs.release == false
123122
with:
124123
name: codecovcli_${{ matrix.distro_name }}_${{ matrix.arch }}
125124
path: ./dist/codecovcli_${{ matrix.distro_name }}_${{ matrix.arch }}
126125
- name: Upload Release Asset
127-
if: github.ref_type == 'tag'
126+
if: inputs.release == true
128127
id: upload-release-asset
129128
uses: svenstaro/upload-release-action@v2
130129
with:

.github/workflows/build_for_pypi.yml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ name: Build and Optionally Publish to PyPi
33

44
on:
55
pull_request:
6-
branches:
7-
- main
8-
push:
9-
# Pattern matched against refs/tags
10-
tags:
11-
- 'v[0-9]+.[0-9]+.[0-9]+'
6+
branches: main
7+
workflow_call:
8+
inputs:
9+
publish:
10+
type: boolean
11+
default: false
12+
description: "Publish to PyPi"
1213

1314
jobs:
1415
build_src_for_pypi:
@@ -64,9 +65,24 @@ jobs:
6465
name: cibw-wheels-${{ matrix.os }}
6566
path: ./wheelhouse/*.whl
6667

68+
test_publish_to_pypi:
69+
if: inputs.publish == false || true
70+
needs:
71+
- build_dist_for_pypi
72+
- build_src_for_pypi
73+
runs-on: ubuntu-latest
74+
steps:
75+
- name: Download artifacts
76+
uses: actions/download-artifact@v4
77+
with:
78+
pattern: cibw-*
79+
- name: Display artifacts
80+
run: |
81+
ls -alrt
82+
ls -alrt dist/
6783
6884
publish_to_pypi:
69-
if: github.ref_type == 'tag'
85+
if: inputs.publish == true || false
7086
needs:
7187
- build_dist_for_pypi
7288
- build_src_for_pypi

0 commit comments

Comments
 (0)