From b9fafcb2fa63bd9b3a303ac550a3a8a105408e47 Mon Sep 17 00:00:00 2001 From: Lexian-droid Date: Tue, 22 Oct 2024 18:26:15 +0200 Subject: [PATCH] New builder Added a new builder, not using someone else's. --- .gitea/workflows/main.yml | 57 -------------------------- .github/workflows/build-and-upload.yml | 45 ++++++++++++++++++++ 2 files changed, 45 insertions(+), 57 deletions(-) delete mode 100644 .gitea/workflows/main.yml create mode 100644 .github/workflows/build-and-upload.yml diff --git a/.gitea/workflows/main.yml b/.gitea/workflows/main.yml deleted file mode 100644 index b8013c9..0000000 --- a/.gitea/workflows/main.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: Resourcepack Zipper - -on: - push: - branches: - - main - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v2 - with: - fetch-depth: 0 # A non-shallow repository clone is required - - - name: Run PackSquash - uses: ComunidadAylas/PackSquash-action@v4 - with: - packsquash_version: latest # Uses the latest PackSquash release supported by the action - shader_source_transformation_strategy: keep_as_is - - - name: Create ZIP file - run: | - COMMIT_ID=$(git rev-parse --short HEAD) - ZIP_NAME="RP.zip" - echo "ZIP_NAME=${ZIP_NAME}" >> $GITHUB_ENV - zip -r "${ZIP_NAME}" . - - - name: Upload ZIP artifact - uses: actions/upload-artifact@v2 - with: - name: resource-pack-artifact - path: ${{ env.ZIP_NAME }} - - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.RESOURCE_ZIPPER }} - with: - tag_name: release-${{ github.sha }} - release_name: Release ${{ github.sha }} - draft: false - prerelease: false - - - name: Upload Release Artifact - id: upload-release-asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.RESOURCE_ZIPPER }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ github.workspace }}/${{ env.ZIP_NAME }} - asset_name: ${{ env.ZIP_NAME }} - asset_content_type: application/zip \ No newline at end of file diff --git a/.github/workflows/build-and-upload.yml b/.github/workflows/build-and-upload.yml new file mode 100644 index 0000000..85ff266 --- /dev/null +++ b/.github/workflows/build-and-upload.yml @@ -0,0 +1,45 @@ +name: Build and Upload Optimized Resource Pack + +# Trigger the workflow on push to the main branch or on pull requests +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + # Step 1: Check out the repository + - name: Checkout Repository + uses: actions/checkout@v3 + + # Step 2: Set up Node.js environment using the latest LTS version + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 'lts/*' # Dynamically uses the latest LTS version + + # Step 3: Install PackSquash globally + - name: Install PackSquash + run: npm install -g packsquash + + # Step 4: Optimize the resource pack using PackSquash + - name: Optimize Resource Pack + run: packsquash optimize ./path-to-your-resource-pack ./optimized-resource-pack + + # Step 5: Zip the optimized resource pack + - name: Zip Optimized Pack + run: | + zip -r optimized-resource-pack.zip ./optimized-resource-pack + + # Step 6: Upload the zipped artifact + - name: Upload Optimized Pack Artifact + uses: actions/upload-artifact@v3 + with: + name: optimized-resource-pack + path: optimized-resource-pack.zip \ No newline at end of file