v27: Druid #15
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Full Package with PlugY and D2DX | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v7 | |
| - name: Get release info | |
| id: rel | |
| run: | | |
| if [ "${{ github.event_name }}" = "release" ]; then | |
| echo "tag=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT | |
| else | |
| LATEST_TAG=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r '.tag_name') | |
| echo "tag=$LATEST_TAG" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Extract d2mods source | |
| run: | | |
| TAG="${{ steps.rel.outputs.tag }}" | |
| REPO="${{ github.event.repository.name }}" | |
| SRC_URL="https://github.com/${{ github.repository }}/archive/refs/tags/${TAG}.zip" | |
| echo "Downloading source: $SRC_URL" | |
| curl -L "$SRC_URL" -o source.zip | |
| unzip -o source.zip | |
| ORIGDIR="${REPO}-${TAG}" | |
| echo "Renaming $ORIGDIR to d2mods-full" | |
| rm -rf d2mods-full | |
| mv "$ORIGDIR" d2mods-full | |
| - name: Download PlugY | |
| run: | | |
| PLUGY_URL=$(curl -s https://api.github.com/repos/ChaosMarc/PlugY/releases/latest \ | |
| | grep browser_download_url \ | |
| | grep 'PlugY_The_Survival_Kit_v' \ | |
| | grep -v 'source' \ | |
| | grep -v 'D2FilePatcher' \ | |
| | head -n 1 \ | |
| | sed -E 's/.*"(https[^"]+)".*/\1/') | |
| echo "PlugY URL: $PLUGY_URL" | |
| curl -L "$PLUGY_URL" -o plugy.zip | |
| unzip -o plugy.zip -d d2mods-full 2>/dev/null || true | |
| - name: Modify PlugY.ini | |
| run: | | |
| INI="d2mods-full/PlugY.ini" | |
| sed -i '/^\[LAUNCHING\]/,/^\[/{s/^Param=.*/Param=-gfx -w -direct -txt/}' "$INI" | |
| sed -i '/^\[MAIN SCREEN\]/,/^\[/{s/^ActivePrintPlugYVersion=.*/ActivePrintPlugYVersion=0/}' "$INI" | |
| - name: Download D2DX | |
| run: | | |
| D2DX_URL=$(curl -s https://api.github.com/repos/Jarcho/d2dx/releases/latest \ | |
| | grep browser_download_url \ | |
| | grep external-res \ | |
| | grep -o 'https.*d2dx-.*external-res\.zip') | |
| echo "d2dx URL: $D2DX_URL" | |
| curl -L "$D2DX_URL" -o d2dx.zip | |
| unzip d2dx.zip -d d2mods-full | |
| - name: Create d2dx.cfg | |
| run: | | |
| CFG="d2mods-full/d2dx.cfg" | |
| cp d2mods-full/d2dx-defaults.cfg "$CFG" | |
| sed -i '/^\[window\]/,/^\[/{s/^scale=1.0/scale=2.0/}' "$CFG" | |
| sed -i '/^\[optouts\]/,/^\[/{s/^nologo=false/nologo=true/}' "$CFG" | |
| - name: Create SGD2FreeResolution.json | |
| run: | | |
| printf '%s\n' \ | |
| '{' \ | |
| ' "SlashGaming Diablo II Free Resolution": {' \ | |
| ' "!!!Metadata (Do not modify)!!!": {' \ | |
| ' "Major Version A": 3,' \ | |
| ' "Major Version B": 0,' \ | |
| ' "Minor Version A": 1,' \ | |
| ' "Minor Version B": 0' \ | |
| ' },' \ | |
| ' "Ingame Resolutions": [' \ | |
| ' "640x480",' \ | |
| ' "800x600",' \ | |
| ' "1024x768",' \ | |
| ' "1440x1080"' \ | |
| ' ],' \ | |
| ' "Ingame Resolution Mode": 1,' \ | |
| ' "Main Menu Resolution": "800x600",' \ | |
| ' "Custom MPQ File": "SGD2FreeRes.mpq",' \ | |
| ' "Enable Screen Border Frame?": true,' \ | |
| ' "Use Original Screen Border Frame?": false,' \ | |
| ' "Use 800 Interface Bar?": true' \ | |
| ' },' \ | |
| ' "!!!Globals!!!": {' \ | |
| ' "Config Tab Width": 4' \ | |
| ' }' \ | |
| '}' \ | |
| > d2mods-full/SGD2FreeResolution.json | |
| - name: Create Mod Package | |
| run: | | |
| cd d2mods-full | |
| zip -r ../d2mods-full.zip . | |
| - name: Upload Mod Package | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| TAG="${{ steps.rel.outputs.tag }}" | |
| ZIPFILE="d2mods-full.zip" | |
| echo "Uploading asset: $ZIPFILE" | |
| gh release upload "$TAG" "$ZIPFILE" --clobber || true |