Skip to content

Commit 4d0cd9b

Browse files
fix: add workflow and pypi test job (#620)
* fix: add workflow and pypi test job * fix: true ls * fix: add path * fix: update release process * fix: publish only
1 parent 85dbe9e commit 4d0cd9b

2 files changed

Lines changed: 22 additions & 19 deletions

File tree

.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: 12 additions & 8 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,8 @@ jobs:
6465
name: cibw-wheels-${{ matrix.os }}
6566
path: ./wheelhouse/*.whl
6667

67-
6868
publish_to_pypi:
69-
if: github.ref_type == 'tag'
69+
if: inputs.publish == true || false
7070
needs:
7171
- build_dist_for_pypi
7272
- build_src_for_pypi
@@ -80,7 +80,11 @@ jobs:
8080
- name: Download artifacts
8181
uses: actions/download-artifact@v4
8282
with:
83+
path: dist/
8384
pattern: cibw-*
85+
- name: Display artifacts
86+
run: |
87+
ls -alrt */*/*
8488
- name: Publish package to PyPi
8589
uses: pypa/gh-action-pypi-publish@release/v1
8690
with:

0 commit comments

Comments
 (0)