@@ -189,8 +189,6 @@ jobs:
189189 steps :
190190 - name : Checkout code
191191 uses : actions/checkout@v4
192- with :
193- token : ${{ secrets.GITHUB_TOKEN }}
194192
195193 - uses : prefix-dev/setup-pixi@v0.8.1
196194 with :
@@ -209,56 +207,46 @@ jobs:
209207 continue-on-error : true
210208 with :
211209 pattern : v1-diff-*
212- path : docs/diffs /
210+ path : diffs_staging /
213211 merge-multiple : true
214212
215- - name : List downloaded diffs
213+ - name : Upload diffs to release
214+ if : github.ref == 'refs/heads/main'
215+ run : |
216+ # Create diffs release if it doesn't exist
217+ gh release view diffs || gh release create diffs --title "Diffoscope Reports" --notes "Auto-updated diffoscope HTML reports for non-reproducible packages"
218+
219+ # Find and upload all diff HTML files
220+ if [ -d "diffs_staging" ]; then
221+ echo "=== Uploading diffs to release ==="
222+ find diffs_staging -type f -name "*.html" | while read -r file; do
223+ # Get just the filename for the asset name
224+ basename=$(basename "$file")
225+ echo "Uploading: $basename"
226+ gh release upload diffs "$file" --clobber || echo "Failed to upload $file"
227+ done
228+ echo "Done uploading diffs"
229+ else
230+ echo "No diffs to upload"
231+ fi
232+ env :
233+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
234+
235+ - name : List uploaded diffs
216236 continue-on-error : true
217237 run : |
218- echo "=== Downloaded Diffs ==="
219- find docs/diffs -type f -name "*.html" 2>/dev/null | head -20 || echo "No diffs found"
220- echo "Total diff files: $(find docs/diffs -type f -name "*.html" 2>/dev/null | wc -l)"
221- echo "=== Directory structure ==="
222- find docs/diffs -type d 2>/dev/null || echo "No dirs"
238+ echo "=== Diffs in release ==="
239+ gh release view diffs --json assets -q '.assets[].name' | head -30 || echo "No diffs release"
240+ env :
241+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
223242
224243 - name : Generate HTML pages
225244 run : |
226245 pixi run repror generate-html
227246
228- - name : List generated files
229- run : |
230- echo "=== Generated HTML files ==="
231- ls -la docs/
232- if [ -d "docs/diffs" ]; then
233- echo "=== Diffs directory ==="
234- find docs/diffs -type f | head -30
235- fi
236-
237- - name : Commit diffs to repository
238- if : github.ref == 'refs/heads/main'
239- run : |
240- git config user.name "github-actions[bot]"
241- git config user.email "github-actions[bot]@users.noreply.github.com"
242-
243- # Add the diffs directory if it exists and has files
244- if [ -d "docs/diffs" ] && [ "$(find docs/diffs -type f -name '*.html' 2>/dev/null | wc -l)" -gt 0 ]; then
245- git add docs/diffs/
246- if ! git diff --staged --quiet; then
247- git commit -m "Update diffoscope HTML reports"
248- git push
249- echo "Diffs committed and pushed"
250- else
251- echo "No changes to commit"
252- fi
253- else
254- echo "No diff files to commit"
255- fi
256-
257247 - name : Update remote docs via API
258248 if : github.ref == 'refs/heads/main'
259249 run : |
260- # Pull latest changes (including diffs we just pushed)
261- git pull --rebase || true
262250 REPROR_UPDATE_TOKEN=${{ secrets.GITHUB_TOKEN }} pixi run repror generate-html --update-remote
263251
264252 summarize-results :
0 commit comments