generated from MrSphay/codex-agent-repository-kit
69 lines
2.3 KiB
YAML
69 lines
2.3 KiB
YAML
name: Decompile upstream jar
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
decompile:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Java
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
distribution: temurin
|
|
java-version: '21'
|
|
|
|
- name: Download upstream mod and CFR
|
|
shell: bash
|
|
run: |
|
|
mkdir -p upstream tools build/decompiled
|
|
curl --fail-with-body --location \
|
|
--output upstream/Explosion-Overhaul-0.2.3.0-forge.jar \
|
|
"https://cdn.modrinth.com/data/sOxnTLKl/versions/93XGK0uB/Explosion-Overhaul-0.2.3.0-forge-.jar"
|
|
curl --fail-with-body --location \
|
|
--output tools/cfr.jar \
|
|
"https://www.benf.org/other/cfr/cfr-0.152.jar"
|
|
|
|
- name: Decompile
|
|
shell: bash
|
|
run: |
|
|
java -jar tools/cfr.jar upstream/Explosion-Overhaul-0.2.3.0-forge.jar \
|
|
--outputdir build/decompiled \
|
|
--silent false \
|
|
--comments false \
|
|
--caseinsensitivefs true
|
|
|
|
- name: Copy metadata
|
|
shell: bash
|
|
run: |
|
|
unzip -p upstream/Explosion-Overhaul-0.2.3.0-forge.jar META-INF/mods.toml > build/decompiled/mods.toml
|
|
unzip -p upstream/Explosion-Overhaul-0.2.3.0-forge.jar explosionoverhaul.mixins.json > build/decompiled/explosionoverhaul.mixins.json
|
|
find build/decompiled -maxdepth 3 -type f | sort > build/decompiled-file-list.txt
|
|
|
|
- name: Upload decompiled sources
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: explosion-overhaul-decompiled-0.2.3.0-forge
|
|
path: |
|
|
build/decompiled/**
|
|
build/decompiled-file-list.txt
|
|
|
|
- name: Push decompiled branch
|
|
shell: bash
|
|
run: |
|
|
worktree="$(mktemp -d)"
|
|
cp -R build/decompiled/. "${worktree}/"
|
|
cp build/decompiled-file-list.txt "${worktree}/decompiled-file-list.txt"
|
|
|
|
git config user.name "Gitea Runner"
|
|
git config user.email "runner@git.wilkensxl.de"
|
|
git switch --orphan runner/decompiled-upstream
|
|
git rm -rf . || true
|
|
cp -R "${worktree}/." .
|
|
git add .
|
|
git commit -m "Decompile upstream Explosion Overhaul 0.2.3.0"
|
|
git push --force origin HEAD:runner/decompiled-upstream
|