Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Nibbl-z committed Nov 30, 2024
2 parents f16c5b2 + 9783b80 commit 684739a
Show file tree
Hide file tree
Showing 20 changed files with 928 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/optimize.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Optimize resource pack
on: [push]
jobs:
packsquash:
name: Optimize resource pack
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4
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
56 changes: 56 additions & 0 deletions .github/workflows/upload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: 'Upload Resource Pack'
on:
workflow_dispatch:
inputs:
resource_pack_url:
description: 'Resource Pack URL'
required: true
default: ''
resource_pack_hash:
description: 'Resource Pack Hash'
required: true
default: ''

jobs:
upload:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install SSH client and sshpass
run: sudo apt-get update && sudo apt-get install -y openssh-client sshpass

- name: Download server.properties
env:
SSH_USERNAME: ${{ secrets.SSH_USERNAME }}
SSH_DOMAIN: ${{ secrets.SSH_DOMAIN }}
SSH_PORT: ${{ secrets.SSH_PORT }}
SSH_PASSWORD: ${{ secrets.SSH_PASSWORD }}
run: |
sshpass -p $SSH_PASSWORD sftp -o StrictHostKeyChecking=no -P $SSH_PORT $SSH_USERNAME@$SSH_DOMAIN << EOF
get server.properties server.properties
bye
EOF
- name: Update server.properties
env:
RESOURCE_PACK_URL: ${{ github.event.inputs.resource_pack_url }}
RESOURCE_PACK_HASH: ${{ github.event.inputs.resource_pack_hash }}
run: |
sed -i "s|^resource-pack=.*|resource-pack=${RESOURCE_PACK_URL}|" server.properties
sed -i "s|^resource-pack-sha1=.*|resource-pack-sha1=${RESOURCE_PACK_HASH}|" server.properties
- name: Upload server.properties
env:
SSH_USERNAME: ${{ secrets.SSH_USERNAME }}
SSH_DOMAIN: ${{ secrets.SSH_DOMAIN }}
SSH_PORT: ${{ secrets.SSH_PORT }}
SSH_PASSWORD: ${{ secrets.SSH_PASSWORD }}
run: |
sshpass -p $SSH_PASSWORD sftp -o StrictHostKeyChecking=no -P $SSH_PORT $SSH_USERNAME@$SSH_DOMAIN << EOF
put server.properties server.properties
bye
EOF
Loading

0 comments on commit 684739a

Please sign in to comment.