Skip to content

Update experimental.yml #418

Update experimental.yml

Update experimental.yml #418

Workflow file for this run

name: Make Experimental Release
on:
workflow_dispatch:
push:
branches: [ "main" ]
permissions:
contents: write
jobs:
make-release:
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v4
# 1. Identify Release ID for 'experimental'
- name: Find release ID
id: find_release
uses: octokit/request-action@v2
with:
route: GET /repos/${{ github.repository }}/releases/tags/experimental
token: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true
# 2. If it exists, delete all assets
- name: Delete all assets from 'experimental'
if: ${{ steps.find_release.outputs.status == 200 }}
run: |
echo "Release found, removing assets."
python <<EOF
import os
import requests
release = """${{ steps.find_release.outputs.data }}"""
import json
release_json = json.loads(release)
assets = release_json.get("assets", [])
token = os.environ["GITHUB_TOKEN"]
for asset in assets:
asset_id = asset["id"]
url = f"https://api.github.com/repos/${{ github.repository }}/releases/assets/{asset_id}"
resp = requests.delete(url, headers={"Authorization": f"Bearer {token}"})
print(f"Deleted asset {asset_id}, status={resp.status_code}")
EOF
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# 3. Build, package, etc. (example placeholders)
- name: Build
run: echo "Building ..."
- name: Package
run: echo "Packaging ..."
# 4. Create or update 'experimental' release with new assets
- name: Release to 'experimentaltest'
uses: softprops/action-gh-release@v1
with:
prerelease: true
tag_name: experimentaltest
body: "Experimental release"
files: |
release/UE4SS_v*.zip
release/zDEV-UE4SS_v*.zip
token: ${{ secrets.GITHUB_TOKEN }}
# 5. Also create or update 'experimental-archive' release
- name: Release to 'experimental-archivetest'
uses: softprops/action-gh-release@v1
with:
prerelease: true
tag_name: experimental-archivetest
body: "Experimental archive release"
files: |
release/UE4SS_v*.zip
release/zDEV-UE4SS_v*.zip
token: ${{ secrets.GITHUB_TOKEN }}