Skip to content

Commit

Permalink
Update experimental.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
narknon authored Dec 29, 2024
1 parent f12f0be commit 2be7b43
Showing 1 changed file with 49 additions and 47 deletions.
96 changes: 49 additions & 47 deletions .github/workflows/experimental.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,75 +4,77 @@ on:
workflow_dispatch:
push:
branches: [ "main" ]
paths:
- "UE4SS/src/**"
- "UE4SS/include/**"
- "UE4SS/generated_src/**"
- "UE4SS/generated_include/**"
- "deps/**"
- "UE4SS/proxy_generator/**"
- "assets/Mods/**"
- "assets/**.ini"

permissions:
contents: read

concurrency:
group: experimental-release
cancel-in-progress: true
contents: write

jobs:
make-release:
permissions: write-all
runs-on: windows-2022

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0 # needed to get commits since last tag
token: ${{ secrets.UEPSEUDO_PAT }}

- name: Setup Python
uses: actions/setup-python@v4
# 1. Identify Release ID for 'experimental'
- name: Find release ID
id: find_release
uses: octokit/request-action@v2
with:
python-version: '3.9'
route: GET /repos/${{ github.repository }}/releases/tags/experimental
token: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true

- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
# 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
- name: Setup xmake
uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: '2.9.3'
release = """${{ steps.find_release.outputs.data }}"""
import json
release_json = json.loads(release)
assets = release_json.get("assets", [])
token = os.environ["GITHUB_TOKEN"]
- name: Cache
uses: actions/cache@v4
with:
path: |
.xmake
Binaries
Intermediates
C:/Users/runneradmin/AppData/Local/.xmake
key: ${{ runner.os }}-xmake-${{ hashFiles('**/xmake.lua') }}
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: |
xmake f -m "Game__Shipping__Win64" -y
xmake build
run: echo "Building ..."

- name: Package
run: python tools/buildscripts/release.py package -e
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 }}

- name: Release
# 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
body_path: release/release_notes.md
tag_name: experimental-archivetest
body: "Experimental archive release"
files: |
release/UE4SS_v*.zip
release/zDEV-UE4SS_v*.zip
release/zCustomGameConfigs.zip
release/zMapGenBP.zip
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 2be7b43

Please sign in to comment.