@@ -97,28 +97,36 @@ jobs:
97
97
run_id : ${{ inputs.run_id }}
98
98
asset_identifier : ' compressed*.whl'
99
99
100
+ - name : check if whl is new
101
+ id : check-whl
102
+ uses : neuralmagic/nm-actions/actions/check-whl-on-pypi@scm
103
+ with :
104
+ whl : ${{ steps.find-asset-whl.outputs.asset }}
105
+
100
106
- name : upload whl to "nm-pypi"
101
- if : ${{ inputs.push_to_pypi }}
107
+ if : ${{ inputs.push_to_pypi && steps.check-whl.outputs.status }}
102
108
uses : neuralmagic/nm-actions/actions/gcp-upload-asset@v1.1.0
103
109
with :
104
110
bucket_target : ${{ secrets.GCP_NM_PYPI_DIST }}
105
111
asset : ${{ steps.find-asset-whl.outputs.asset }}
106
112
107
113
- name : find tar.gz
114
+ if : ${{ steps.check-whl.outputs.status }}
108
115
id : find-asset-targz
109
116
uses : neuralmagic/nm-actions/actions/find-asset@v1.1.0
110
117
with :
111
118
run_id : ${{ inputs.run_id }}
112
119
asset_identifier : ' compressed*.tar.gz'
113
120
114
121
- name : upload tar.gz to "nm-pypi"
115
- if : ${{ inputs.push_to_pypi }}
122
+ if : ${{ inputs.push_to_pypi && steps.check-whl.outputs.status }}
116
123
uses : neuralmagic/nm-actions/actions/gcp-upload-asset@v1.1.0
117
124
with :
118
125
bucket_target : ${{ secrets.GCP_NM_PYPI_DIST }}
119
126
asset : ${{ steps.find-asset-targz.outputs.asset }}
120
127
121
128
- name : update "nm-pypi" index
129
+ if : ${{ steps.check-whl.outputs.status }}
122
130
uses : actions/github-script@v6
123
131
with :
124
132
github-token : ${{ secrets.NM_PYPI_WORKFLOW }}
@@ -133,7 +141,7 @@ jobs:
133
141
134
142
# publish the wheel file to public pypi
135
143
- name : push wheel to pypi.org
136
- if : ${{ inputs.push_to_pypi }}
144
+ if : ${{ inputs.push_to_pypi && steps.check-whl.outputs.status }}
137
145
uses : neuralmagic/nm-actions/actions/publish-whl@v1.0.0
138
146
with :
139
147
username : ${{ secrets.PYPI_PUBLIC_USER }}
@@ -142,7 +150,7 @@ jobs:
142
150
143
151
# publish the tar.gz file to public pypi
144
152
- name : push wheel to pypi.org
145
- if : ${{ inputs.push_to_pypi }}
153
+ if : ${{ inputs.push_to_pypi && steps.check-whl.outputs.status }}
146
154
uses : neuralmagic/nm-actions/actions/publish-whl@v1.0.0
147
155
with :
148
156
username : ${{ secrets.PYPI_PUBLIC_USER }}
0 commit comments