diff --git a/.github/workflows/auto-update.yml b/.github/workflows/auto-update.yml index 9cd1dd360..387e6ded2 100644 --- a/.github/workflows/auto-update.yml +++ b/.github/workflows/auto-update.yml @@ -19,16 +19,34 @@ jobs: - uses: actions/checkout@v4 with: token: ${{ secrets.GH_PAT }} + fetch-depth: 1 + # Cache Packwiz binary to avoid Go setup and compilation + - name: Cache Packwiz Binary + uses: actions/cache@v4 + id: cache-packwiz + with: + path: ~/go/bin/packwiz + key: packwiz-binary-${{ runner.os }}-v1 + restore-keys: | + packwiz-binary-${{ runner.os }}- + + # Only set up Go and install Packwiz if not cached - name: Set up Go + if: steps.cache-packwiz.outputs.cache-hit != 'true' uses: actions/setup-go@v5 with: go-version: 'stable' cache: false - name: Install Packwiz + if: steps.cache-packwiz.outputs.cache-hit != 'true' run: go install github.com/packwiz/packwiz@latest + # Add Packwiz to PATH (whether cached or freshly installed) + - name: Add Packwiz to PATH + run: echo "$HOME/go/bin" >> $GITHUB_PATH + - name: Update ${{ matrix.modpack }} - ${{ matrix.platform }} - ${{ matrix.loader }} - ${{ matrix.minecraft }} run: | DIR="./versions/vanilla/src/${{ matrix.modpack }}/${{ matrix.platform }}/${{ matrix.loader }}/${{ matrix.minecraft }}" @@ -46,11 +64,12 @@ jobs: commit-changes: needs: update-modpacks - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 with: token: ${{ secrets.GH_PAT }} + fetch-depth: 1 - name: Pull latest changes run: git pull origin main diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e9ff99c9b..30f20c904 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -155,16 +155,35 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + with: + fetch-depth: 1 + # Cache Packwiz binary to avoid Go setup and compilation + - name: Cache Packwiz Binary + uses: actions/cache@v4 + id: cache-packwiz + with: + path: ~/go/bin/packwiz + key: packwiz-binary-${{ runner.os }}-v1 + restore-keys: | + packwiz-binary-${{ runner.os }}- + + # Only set up Go and install Packwiz if not cached - name: Set up Go + if: steps.cache-packwiz.outputs.cache-hit != 'true' uses: actions/setup-go@v5 with: go-version: 'stable' cache: false - name: Install Packwiz + if: steps.cache-packwiz.outputs.cache-hit != 'true' run: go install github.com/packwiz/packwiz@latest + # Add Packwiz to PATH (whether cached or freshly installed) + - name: Add Packwiz to PATH + run: echo "$HOME/go/bin" >> $GITHUB_PATH + - name: Set version and commit SHA id: version run: | diff --git a/.github/workflows/rc-builds.yml b/.github/workflows/rc-builds.yml index aca38ba02..79e7e8b44 100644 --- a/.github/workflows/rc-builds.yml +++ b/.github/workflows/rc-builds.yml @@ -79,16 +79,35 @@ jobs: OUTPUT: artifacts steps: - uses: actions/checkout@v4 + with: + fetch-depth: 1 + # Cache Packwiz binary to avoid Go setup and compilation + - name: Cache Packwiz Binary + uses: actions/cache@v4 + id: cache-packwiz + with: + path: ~/go/bin/packwiz + key: packwiz-binary-${{ runner.os }}-v1 + restore-keys: | + packwiz-binary-${{ runner.os }}- + + # Only set up Go and install Packwiz if not cached - name: Set up Go + if: steps.cache-packwiz.outputs.cache-hit != 'true' uses: actions/setup-go@v5 with: go-version: 'stable' cache: false - name: Install Packwiz + if: steps.cache-packwiz.outputs.cache-hit != 'true' run: go install github.com/packwiz/packwiz@latest + # Add Packwiz to PATH (whether cached or freshly installed) + - name: Add Packwiz to PATH + run: echo "$HOME/go/bin" >> $GITHUB_PATH + - name: Create short commit SHA id: vars run: | diff --git a/.github/workflows/rc-lite-builds.yml b/.github/workflows/rc-lite-builds.yml index ef65abe46..9eaef5072 100644 --- a/.github/workflows/rc-lite-builds.yml +++ b/.github/workflows/rc-lite-builds.yml @@ -79,16 +79,35 @@ jobs: OUTPUT: artifacts steps: - uses: actions/checkout@v4 + with: + fetch-depth: 1 + # Cache Packwiz binary to avoid Go setup and compilation + - name: Cache Packwiz Binary + uses: actions/cache@v4 + id: cache-packwiz + with: + path: ~/go/bin/packwiz + key: packwiz-binary-${{ runner.os }}-v1 + restore-keys: | + packwiz-binary-${{ runner.os }}- + + # Only set up Go and install Packwiz if not cached - name: Set up Go + if: steps.cache-packwiz.outputs.cache-hit != 'true' uses: actions/setup-go@v5 with: go-version: 'stable' cache: false - name: Install Packwiz + if: steps.cache-packwiz.outputs.cache-hit != 'true' run: go install github.com/packwiz/packwiz@latest + # Add Packwiz to PATH (whether cached or freshly installed) + - name: Add Packwiz to PATH + run: echo "$HOME/go/bin" >> $GITHUB_PATH + - name: Create short commit SHA id: vars run: |