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