simpliplay-desktop/.github/workflows/draft-release.yml
2025-08-06 17:50:52 -05:00

69 lines
2.0 KiB
YAML

name: Draft Release
on:
workflow_dispatch:
jobs:
create-draft-release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Prepare folder
run: mkdir -p all-artifacts
- name: Poll for expected artifacts
run: |
echo "Polling (every 15 seconds) until all required artifacts are available..."
REQUIRED=("linux-x64-appimage" "linux-x64-snap" "linux-arm64-snap" "builds" "builds-x64" "builds-arm64")
while true; do
echo "⏳ Checking artifacts..."
# Clean up and re-download artifacts each poll
rm -rf all-artifacts
mkdir -p all-artifacts
# This will download all available artifacts for this run
gh run download --dir all-artifacts || true
missing=0
for ARTIFACT in "${REQUIRED[@]}"; do
if [ ! -d "all-artifacts/$ARTIFACT" ]; then
echo "❌ Missing: $ARTIFACT"
missing=1
fi
done
if [ "$missing" -eq 0 ]; then
echo "✅ All required artifacts found."
break
fi
echo "🔁 Not all artifacts found. Retrying in 15 seconds..."
sleep 15
done
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Show downloaded files
run: ls -R all-artifacts
- name: Prepare list of files to upload
run: |
find all-artifacts -type f \( -iname "*.exe" -o -iname "*.dmg" -o -iname "*.snap" -o -iname "*.AppImage" \) > upload-files.txt
echo "Files to upload:"
cat upload-files.txt
- name: Create GitHub Draft Release
uses: softprops/action-gh-release@v2
with:
tag_name: "draft-${{ github.run_number }}"
draft: true
files: $(cat upload-files.txt)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}