Fix Git LFS checkout in workflow to properly handle resourcepack.zip #4
This file contains hidden or 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: Upload ResourcePack | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
jobs: | |
upload-resourcepack: | |
runs-on: ubuntu-latest | |
steps: | |
# First install Git LFS | |
- name: Install Git LFS | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y git-lfs | |
# Properly checkout with LFS | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
lfs: true | |
fetch-depth: 0 | |
# Pull LFS files explicitly | |
- name: Pull LFS files | |
run: | | |
git lfs install | |
git lfs pull | |
# Verify the file exists | |
- name: Verify resourcepack.zip | |
run: | | |
echo "Listing all files:" | |
ls -la | |
echo "LFS files:" | |
git lfs ls-files | |
echo "Checking resourcepack.zip:" | |
ls -la resourcepack.zip || echo "File not found" | |
- name: Upload resourcepack as artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: resourcepack | |
path: resourcepack.zip | |
if-no-files-found: error |