Add Squirrel Hat (made by luquacks_br) #106
This file contains 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: Continuous Integration | |
# Controls when the action will run. Triggers the workflow on push or pull request. | |
on: [ push ] | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-24.04 | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
# java2bedrock REQUIRES jq 1.6, and fails if you have a newer jq version | |
- name: Install java2bedrock.sh dependencies | |
run: | | |
sudo apt-get install moreutils imagemagick unzip zip uuid-runtime | |
sudo wget -O /usr/bin/jq "https://github.com/jqlang/jq/releases/download/jq-1.6/jq-linux64" | |
sudo npm install -g [email protected] | |
sudo npm i -g spritesheet-js | |
- name: Setup Java JDK | |
uses: actions/[email protected] | |
with: | |
java-version: 17 | |
- name: Get current date | |
id: date | |
run: echo "::set-output name=date::$(date +'%d%m%Y')" | |
- name: Compress Resource Pack | |
# This will also exclude the ".git" and ".github" folders from the Resource Pack | |
env: | |
DATE: ${{ steps.date.outputs.date }} | |
run: zip -9 -r SparklyPowerPlus_$DATE.zip . -x '*.git*' -x '*SparklyBedrockConverter*' -x 'pre_process_bedrock_resource_pack.sh' | |
- name: "Get SHA1 Hash of the Java Resource Pack and Send to GitHub Output" | |
env: | |
DATE: ${{ steps.date.outputs.date }} | |
run: echo "$(sha1sum SparklyPowerPlus_$DATE.zip)" >> $GITHUB_STEP_SUMMARY | |
- name: "Upload Java Resource Pack" | |
uses: actions/[email protected] | |
with: | |
name: SparklyPowerPlus Java | |
path: SparklyPowerPlus_${{ steps.date.outputs.date }}.zip | |
- name: Run Preprocess Bedrock Resource Pack Script | |
env: | |
DATE: ${{ steps.date.outputs.date }} | |
# Yes, the resource pack needs to be in the same folder as the script | |
run: | | |
chmod 777 pre_process_bedrock_resource_pack.sh | |
./pre_process_bedrock_resource_pack.sh | |
- name: Compress Resource Pack for Bedrock | |
# This will also exclude the ".git" and ".github" folders from the Resource Pack | |
env: | |
DATE: ${{ steps.date.outputs.date }} | |
run: zip -9 -r SparklyPowerPlus_Bedrock_$DATE.zip . -x '*.git*' -x '*SparklyBedrockConverter*' | |
# This is required because converter.sh seems to delete the "assets" folder | |
- name: Create new folder for the Bedrock Resource Pack and cd into it | |
run: | | |
mkdir bedrock_rp | |
cd bedrock_rp | |
- name: Download java2bedrock.sh | |
run: | | |
cd bedrock_rp | |
curl -o converter.sh https://raw.githubusercontent.com/Kas-tle/java2bedrock.sh/main/converter.sh | |
- name: Convert Java Resource Pack to Bedrock | |
env: | |
DATE: ${{ steps.date.outputs.date }} | |
# Yes, the resource pack needs to be in the same folder as the script | |
run: | | |
mv SparklyPowerPlus_Bedrock_$DATE.zip bedrock_rp | |
cd bedrock_rp | |
chmod 777 converter.sh | |
./converter.sh SparklyPowerPlus_Bedrock_$DATE.zip -w "false" -m "MyBedrock.mcpack" -a "entity_alphatest_one_sided" -b "alpha_test" -f "null" -v "1.19.2" | |
- name: Grant execute permission for gradlew | |
run: chmod +x SparklyBedrockConverter/gradlew | |
- name: Run SparklyBedrockConverter for the final touches for the Bedrock RP | |
# I tried using gradle-build-action, but the "--args" were always merged into a single argument | |
env: | |
DATE: ${{ steps.date.outputs.date }} | |
run: | | |
rootPwd=$(pwd) | |
cd bedrock_rp | |
bedrockPwd=$(pwd) | |
echo "Current path is $cwd" | |
cd ../SparklyBedrockConverter | |
./gradlew run --args="$rootPwd $bedrockPwd/target/unpackaged/rp $bedrockPwd/target/geyser_mappings.json" | |
- name: Compress Bedrock Resource Pack | |
# This will also exclude the ".git" and ".github" folders from the Resource Pack | |
env: | |
DATE: ${{ steps.date.outputs.date }} | |
run: | | |
cd bedrock_rp | |
(cd target/unpackaged/rp && zip -9 -r "$OLDPWD/SparklyPowerPlus_Bedrock_$DATE.mcpack" .) | |
- name: "Upload Bedrock Resource Pack" | |
uses: actions/[email protected] | |
with: | |
name: SparklyPowerPlus Bedrock | |
path: bedrock_rp/SparklyPowerPlus_Bedrock_${{ steps.date.outputs.date }}.mcpack | |
- name: "Upload Geyser Mappings" | |
uses: actions/[email protected] | |
with: | |
name: geyser_mappings.json | |
path: bedrock_rp/target/geyser_mappings.json |