1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-10-01 12:30:00 +02:00

gha(release): Hopefully fixes it

This commit is contained in:
Mary 2023-03-11 19:13:40 +01:00
parent a80fa5e33f
commit 2dc422bc14
2 changed files with 21 additions and 16 deletions

View file

@ -3,7 +3,10 @@ name: Flatpak release job
on: on:
workflow_call: workflow_call:
inputs: inputs:
ryujinx_version: ryujinx_base_version:
required: true
type: string
ryujinx_version_minor:
required: true required: true
type: string type: string
@ -20,7 +23,7 @@ jobs:
GIT_COMMITTER_EMAIL: "61127645+RyujinxBot@users.noreply.github.com" GIT_COMMITTER_EMAIL: "61127645+RyujinxBot@users.noreply.github.com"
RYUJINX_PROJECT_FILE: "Ryujinx/Ryujinx.csproj" RYUJINX_PROJECT_FILE: "Ryujinx/Ryujinx.csproj"
NUGET_SOURCES_DESTDIR: "nuget-sources" NUGET_SOURCES_DESTDIR: "nuget-sources"
RYUJINX_VERSION: ${{ inputs.ryujinx_version }} RYUJINX_VERSION: "${{ inputs.ryujinx_base_version }}. ${{ inputs.ryujinx_version_minor }}"
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
@ -58,9 +61,9 @@ jobs:
import binascii import binascii
import json import json
import os import os
sources = [] sources = []
for path in Path((os.environ['NUGET_PACKAGES']).glob('**/*.nupkg.sha512'): for path in Path((os.environ['NUGET_PACKAGES']).glob('**/*.nupkg.sha512'):
name = path.parent.parent.name name = path.parent.parent.name
version = path.parent.name version = path.parent.name
@ -94,13 +97,13 @@ jobs:
import yaml import yaml
from datetime import datetime from datetime import datetime
from lxml import etree from lxml import etree
yaml_file = "flathub/org.ryujinx.Ryujinx.yml" yaml_file = "flathub/org.ryujinx.Ryujinx.yml"
xml_file = "flathub/org.ryujinx.Ryujinx.appdata.xml" xml_file = "flathub/org.ryujinx.Ryujinx.appdata.xml"
with open(yaml_file, "r") as f: with open(yaml_file, "r") as f:
data = yaml.safe_load(f) data = yaml.safe_load(f)
for source in data["modules"][0]["sources"]: for source in data["modules"][0]["sources"]:
if type(source) is str: if type(source) is str:
continue continue
@ -109,7 +112,7 @@ jobs:
and source["url"] == "https://github.com/Ryujinx/Ryujinx.git" and source["url"] == "https://github.com/Ryujinx/Ryujinx.git"
): ):
source["commit"] = os.environ['RYUJINX_GIT_HASH'] source["commit"] = os.environ['RYUJINX_GIT_HASH']
is_same_version = data["modules"][0]["build-options"]["env"]["RYUJINX_VERSION"] == os.environ['RYUJINX_VERSION'] is_same_version = data["modules"][0]["build-options"]["env"]["RYUJINX_VERSION"] == os.environ['RYUJINX_VERSION']
with open(os.environ['GITHUB_OUTPUT'], "a") as gh_out: with open(os.environ['GITHUB_OUTPUT'], "a") as gh_out:
@ -117,28 +120,28 @@ jobs:
gh_out.write(f"commit_message=Retry update to {os.environ['RYUJINX_VERSION']}") gh_out.write(f"commit_message=Retry update to {os.environ['RYUJINX_VERSION']}")
else: else:
gh_out.write(f"commit_message=Update to {os.environ['RYUJINX_VERSION']}") gh_out.write(f"commit_message=Update to {os.environ['RYUJINX_VERSION']}")
if not is_same_version: if not is_same_version:
data["modules"][0]["build-options"]["env"]["RYUJINX_VERSION"] = os.environ['RYUJINX_VERSION'] data["modules"][0]["build-options"]["env"]["RYUJINX_VERSION"] = os.environ['RYUJINX_VERSION']
with open(yaml_file, "w") as f: with open(yaml_file, "w") as f:
yaml.safe_dump(data, f, sort_keys=False) yaml.safe_dump(data, f, sort_keys=False)
parser = etree.XMLParser(remove_blank_text=True) parser = etree.XMLParser(remove_blank_text=True)
tree = etree.parse(xml_file, parser) tree = etree.parse(xml_file, parser)
root = tree.getroot() root = tree.getroot()
releases = root.find("releases") releases = root.find("releases")
element = etree.Element("release") element = etree.Element("release")
element.set("version", os.environ['RYUJINX_VERSION']) element.set("version", os.environ['RYUJINX_VERSION'])
element.set("date", datetime.now().date().isoformat()) element.set("date", datetime.now().date().isoformat())
releases.insert(0, element) releases.insert(0, element)
# Ensure 4 spaces # Ensure 4 spaces
etree.indent(root, space=" ") etree.indent(root, space=" ")
with open(xml_file, "wb") as f: with open(xml_file, "wb") as f:
f.write( f.write(
etree.tostring( etree.tostring(

View file

@ -114,6 +114,8 @@ jobs:
flatpak_release: flatpak_release:
uses: ./.github/workflows/flatpak.yml uses: ./.github/workflows/flatpak.yml
needs: release
with: with:
ryujinx_version: "${{ env.RYUJINX_BASE_VERSION }}.${{ github.run_number }}" ryujinx_base_version: "1.1"
ryujinx_version_minor: github.run_number
secrets: inherit secrets: inherit