diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6da528e96..3b7f01c97 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,72 +7,84 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.8 + - uses: actions/checkout@master - - name: Archive Release - uses: thedoctor0/zip-release@master - with: - filename: 'dev.zip' - exclusions: '*.git* README.md *.schema* *.zip *.py run/*' + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 - - name: Delete dev files - run: rm assets/minecraft/textures/particle/effect_* + - name: Archive Release + uses: thedoctor0/zip-release@master + with: + filename: 'dev.zip' + exclusions: '*.git* README.md *.schema* *.zip *.py run/*' - - name: Archive Release - uses: thedoctor0/zip-release@master - with: - filename: 'patreon.zip' - exclusions: '*.git* README.md *.schema* *.zip *.py run/*' + - name: Delete dev files + run: rm assets/minecraft/textures/particle/effect_* - - name: Run script - run: python .github/scripts/process_input.py + - name: Archive Release + uses: thedoctor0/zip-release@master + with: + filename: 'patreon.zip' + exclusions: '*.git* README.md *.schema* *.zip *.py run/*' - - name: Archive Release - uses: thedoctor0/zip-release@master - with: - filename: '20.zip' - exclusions: '*.git* README.md *.schema* *.zip *.py run/*' + - name: Run script + run: python .github/scripts/process_input.py - - name: Reset specific files or directories - run: | - git checkout -- assets/ - rm assets/minecraft/textures/particle/effect_* - rm -R assets/minecraft/textures/item/custom/noted - rm -R assets/ms/models/noted - sed -i 's/ms:noted\/[a-zA-Z_0-9]*\b/ms:wooden_shovel\/note/g' assets/minecraft/models/item/carrot.json + - name: Archive Release + uses: thedoctor0/zip-release@master + with: + filename: '20.zip' + exclusions: '*.git* README.md *.schema* *.zip *.py run/*' - - name: Archive Release - uses: thedoctor0/zip-release@master - with: - filename: 'patreon_low.zip' - exclusions: '*.git* README.md *.schema* *.zip *.py run/*' + - name: Reset specific files or directories + run: | + git checkout -- assets/ + rm assets/minecraft/textures/particle/effect_* + rm -R assets/minecraft/textures/item/custom/noted + rm -R assets/ms/models/noted + sed -i 's/ms:noted\/[a-zA-Z_0-9]*\b/ms:wooden_shovel\/note/g' assets/minecraft/models/item/carrot.json - - name: Run script - run: python .github/scripts/process_input.py + - name: Archive Release + uses: thedoctor0/zip-release@master + with: + filename: 'patreon_low.zip' + exclusions: '*.git* README.md *.schema* *.zip *.py run/*' - - name: Archive Release - uses: thedoctor0/zip-release@master - with: - filename: '20_low.zip' - exclusions: '*.git* README.md *.schema* *.zip *.py run/*' + - name: Run script + run: python .github/scripts/process_input.py - - name: Delete - uses: ame-yu/action-delete-latest-release@v2 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - - - name: Upload Release - uses: ncipollo/release-action@v1 - with: - artifacts: "patreon.zip,patreon_low.zip,dev.zip,20.zip,20_low.zip,run/noted.txt" - tag: "patreon" - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Update pack on server - run: curl -X GET "${{ secrets.UPDATE_URL }}" + - name: Archive Release + uses: thedoctor0/zip-release@master + with: + filename: '20_low.zip' + exclusions: '*.git* README.md *.schema* *.zip *.py run/*' + - name: Delete + uses: ame-yu/action-delete-latest-release@v2 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Calculate SHA1 Hashes + run: | + for file in resourcepack.zip resourcepack_low.zip resourcepack_20.zip resourcepack_20_low.zip; do + sha1sum $file > $file.sha1 + done + + - name: Upload Resourcepack Release with SHA1 + uses: ncipollo/release-action@v1 + with: + artifacts: 'resourcepack.zip,resourcepack_low.zip,resourcepack_20.zip,resourcepack_20_low.zip,resourcepack.zip.sha1,resourcepack_low.zip.sha1,resourcepack_20.zip.sha1,resourcepack_20_low.zip.sha1' + tag: 'resourcepack-${{ github.sha }}' + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload Patreon Release + uses: ncipollo/release-action@v1 + with: + artifacts: 'patreon.zip,patreon_low.zip,dev.zip,20.zip,20_low.zip,run/noted.txt' + tag: 'patreon' + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Update pack on server + run: curl -X GET "${{ secrets.UPDATE_URL }}"