Update v4.22 #42
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: Build and Release Resource Pack | |
| on: | |
| push: | |
| tags: | |
| - 'v2.8.X/v*' # Trigger only on tags like v2.8.X/v* | |
| jobs: | |
| build_and_release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Show GitHub context (debug) | |
| run: | | |
| echo "GITHUB_REF: $GITHUB_REF" | |
| echo "GITHUB_REF_NAME: ${{ github.ref_name }}" | |
| echo "GITHUB_SHA: $GITHUB_SHA" | |
| - name: Extract tag name (debug) | |
| id: vars | |
| run: | | |
| TAG="${GITHUB_REF#refs/tags/}" | |
| echo "Extracted TAG: $TAG" | |
| echo "PACK_VERSION=${TAG#v2.8.X/}" | |
| echo "TAG=$TAG" >> $GITHUB_OUTPUT | |
| echo "PACK_VERSION=${TAG#v2.8.X/}" >> $GITHUB_OUTPUT | |
| - name: Debug checkout info before checkout | |
| run: | | |
| git --version | |
| git tag -l || echo "No tags found yet" | |
| git log -1 || echo "No commits found" | |
| - name: Checkout main branch | |
| uses: actions/checkout@v3 | |
| with: | |
| ref: main | |
| path: main | |
| fetch-depth: 0 | |
| - name: Checkout modernity branch | |
| uses: actions/checkout@v3 | |
| with: | |
| ref: modernity | |
| path: modernity | |
| fetch-depth: 0 | |
| - name: Debug git tags after checkout | |
| run: | | |
| echo "Tags in main branch:" | |
| cd main | |
| git tag -l | |
| cd .. | |
| echo "Tags in modernity branch:" | |
| cd modernity | |
| git tag -l | |
| cd .. | |
| - name: Install dependencies | |
| run: sudo apt-get update && sudo apt-get install -y jq zip | |
| - name: Prepare and zip main branch pack | |
| run: | | |
| cd main | |
| PACK_META="pack.mcmeta" | |
| DESC="§8GTNH v2.8.X §f/ §3Pack ${{ steps.vars.outputs.PACK_VERSION }} §aby Ranzu" | |
| jq --arg desc "$DESC" '.pack.description = $desc' "$PACK_META" > temp.mcmeta && mv temp.mcmeta "$PACK_META" | |
| ZIP_NAME="Shadow UI ${{ steps.vars.outputs.PACK_VERSION }}.zip" | |
| zip -r "$ZIP_NAME" assets pack.mcmeta pack.png README.md | |
| echo "$ZIP_NAME" > ../main_zip_name.txt | |
| shell: bash | |
| - name: Prepare and zip modernity branch pack | |
| run: | | |
| cd modernity | |
| PACK_META="pack.mcmeta" | |
| DESC="§8GTNH v2.8.X §f/ §3Pack ${{ steps.vars.outputs.PACK_VERSION }} §f- §2Modernity version §aby Ranzu" | |
| jq --arg desc "$DESC" '.pack.description = $desc' "$PACK_META" > temp.mcmeta && mv temp.mcmeta "$PACK_META" | |
| ZIP_NAME="Shadow UI ${{ steps.vars.outputs.PACK_VERSION }}-Modernity version.zip" | |
| zip -r "$ZIP_NAME" assets pack.mcmeta pack.png README.md | |
| echo "$ZIP_NAME" > ../modernity_zip_name.txt | |
| shell: bash | |
| - name: Read ZIP file names | |
| id: zipfiles | |
| run: | | |
| MAIN_ZIP=$(cat main_zip_name.txt) | |
| MODERNITY_ZIP=$(cat modernity_zip_name.txt) | |
| echo "MAIN_ZIP=$MAIN_ZIP" >> $GITHUB_OUTPUT | |
| echo "MODERNITY_ZIP=$MODERNITY_ZIP" >> $GITHUB_OUTPUT | |
| - name: Debug Release Inputs | |
| run: | | |
| echo "Release tag_name: ${{ steps.vars.outputs.TAG }}" | |
| echo "Release name: Shadow UI ${{ steps.vars.outputs.PACK_VERSION }}" | |
| echo "Files to upload:" | |
| echo "main/${{ steps.zipfiles.outputs.MAIN_ZIP }}" | |
| echo "modernity/${{ steps.zipfiles.outputs.MODERNITY_ZIP }}" | |
| - name: Upload Release with both ZIPs | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ steps.vars.outputs.TAG }} | |
| name: Shadow UI ${{ steps.vars.outputs.PACK_VERSION }} | |
| prerelease: false | |
| body: | | |
| ### Version Info | |
| - Minecraft 1.7.10 | |
| - GTNH 2.8.X | |
| - Pack version ${{ steps.vars.outputs.PACK_VERSION }} | |
| files: | | |
| main/${{ steps.zipfiles.outputs.MAIN_ZIP }} | |
| modernity/${{ steps.zipfiles.outputs.MODERNITY_ZIP }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |