2424 publish-package :
2525 required : true
2626 type : boolean
27+ output-packages :
28+ required : false
29+ type : string
2730 git-sha :
2831 required : false
2932 type : string
8992 echo "PKG_DIR=$CONDA_PREFIX/rattler-bld" >> $GITHUB_ENV
9093 fi
9194
95+ - name : Setup output packages
96+ shell : bash -l {0}
97+ run : |
98+ if [ -z "${{ inputs.output-packages }}" ]; then
99+ echo "OUTPUT_PKGS=[\'${{ inputs.package-name }}\']" >> $GITHUB_ENV
100+ else
101+ echo "OUTPUT_PKGS=${{ inputs.output-packages }}" >> $GITHUB_ENV
102+ fi
103+
92104 - name : Show conda config
93105 shell : bash -l {0}
94106 run : |
@@ -143,8 +155,10 @@ jobs:
143155 shell : bash -l {0}
144156 run : |
145157 cd ${{ env.PKG_DIR }}/${{ inputs.platform }}
146- for file in *${{ inputs.package-name }}*.conda; do
147- curl -X DELETE https://prefix.dev/api/v1/delete/${{ inputs.channel }}/${{ inputs.platform }}/$file -H "Authorization: Bearer ${{ secrets.api-key }}"
158+ for PKG_FILE in $(echo "${{ env.OUTPUT_PKGS }}" | tr -d '[]' | tr ',' '\n' | xargs); do
159+ for file in *$PKG_FILE*.conda; do
160+ curl -X DELETE https://prefix.dev/api/v1/delete/${{ inputs.channel }}/${{ inputs.platform }}/$file -H "Authorization: Bearer ${{ secrets.api-key }}"
161+ done
148162 done
149163
150164 # For devel packages, we only keep last build. So we will remove previous one(s) after successful publish
@@ -153,14 +167,24 @@ jobs:
153167 id : query_filenames
154168 shell : bash -l {0}
155169 run : |
156- echo "result=$(python .github/workflows/fetch_packages_names.py --channel ${{ inputs.channel }} --package ${{ inputs.package-name }} --platform ${{ inputs.platform }})" >> $GITHUB_OUTPUT
170+ result='[]'
171+ for PKG_FILE in $(echo "${{ env.OUTPUT_PKGS }}" | tr -d '[]' | tr ',' '\n' | xargs); do
172+ new=$(python fetch_packages_names.py --channel ${{ inputs.channel }} --package $PKG_FILE --platform ${{ inputs.platform }})
173+ result=$(
174+ jq -c --argjson nxt "$new" \
175+ '. + $nxt' <<< "$result"
176+ )
177+ done
178+ echo "$result >> $GITHUB_OUTPUT"
157179
158180 - name : Publish conda package
159181 if : ${{ inputs.publish-package == true }}
160182 shell : bash -l {0}
161183 run : |
162- for file in ${{ env.PKG_DIR }}/**/*${{ inputs.package-name }}*.conda; do
163- rattler-build upload prefix -c ${{ inputs.channel }} --api-key ${{ secrets.api-key }} "$file"
184+ for PKG_FILE in $(echo "${{ env.OUTPUT_PKGS }}" | tr -d '[]' | tr ',' '\n' | xargs); do
185+ for file in ${{ env.PKG_DIR }}/**/*$PKG_FILE*.conda; do
186+ rattler-build upload prefix -c ${{ inputs.channel }} --api-key ${{ secrets.api-key }} "$file"
187+ done
164188 done
165189
166190 - name : Remove existing package [devel]
0 commit comments