From 06ad38d2374c9dedd87379ae66d6ac33a8ebd852 Mon Sep 17 00:00:00 2001 From: omo50 <144749186+omo50@users.noreply.github.com> Date: Sat, 18 Apr 2026 13:36:22 -0600 Subject: [PATCH] fix(ci): fix the build --- .forgejo/workflows/build.yml | 38 +++++++++++++++++------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index 0ed300f6d..8c5607436 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -2,13 +2,17 @@ name: "Build" on: push: - branches: [ "main" ] + branches: ["main"] paths: - 'modpacks/**' - - 'resourcepacks/**' - 'datapacks/**' + - 'src/actions/**' pull_request: - branches: [ "main" ] + branches: ["main"] + paths: + - 'modpacks/**' + - 'datapacks/**' + - 'src/actions/**' workflow_dispatch: jobs: @@ -22,19 +26,13 @@ jobs: filter: blob:none sparse-checkout: | modpacks - resourcepacks datapacks src/actions - name: Meta id: meta run: | - MANIFEST=$(git diff-tree --no-commit-id --name-only -r HEAD | grep 'manifest.json' | head -n 1) - - if [ -z "$MANIFEST" ]; then MANIFEST="modpacks/simply-legacy/manifest.json"; fi - SHORT_SHA=$(git rev-parse --short HEAD) - echo "manifest=$MANIFEST" >> $GITHUB_OUTPUT echo "short_sha=$SHORT_SHA" >> $GITHUB_OUTPUT - name: Cache Go Binaries @@ -42,9 +40,10 @@ jobs: uses: actions/cache@v4 with: path: ~/go/bin - key: go-bin-v1-${{ runner.os }} + key: go-bin-packwiz-v1-${{ runner.os }} - name: Setup Go + if: steps.cache-go.outputs.cache-hit != 'true' uses: actions/setup-go@v5 with: go-version: 'stable' @@ -52,10 +51,9 @@ jobs: - name: Install Packwiz if: steps.cache-go.outputs.cache-hit != 'true' - run: | - go install github.com/packwiz/packwiz@latest - - - name: Add Path + run: go install github.com/packwiz/packwiz@latest + + - name: Add Go bin to PATH run: echo "$HOME/go/bin" >> $GITHUB_PATH - name: Install Rust @@ -66,9 +64,9 @@ jobs: uses: actions/cache@v4 with: path: ./builder-bin - key: builder-v1-${{ runner.os }}-${{ hashFiles('src/actions/publish.rs') }} + key: builder-v1-${{ runner.os }}-${{ hashFiles('src/actions/**/*.rs', 'src/actions/Cargo.toml', 'src/actions/Cargo.lock') }} - - name: Rust Cache (Compiler Internals) + - name: Rust Cache if: steps.cache-builder.outputs.cache-hit != 'true' uses: Swatinem/rust-cache@v2 with: @@ -77,17 +75,17 @@ jobs: - name: Build Builder if: steps.cache-builder.outputs.cache-hit != 'true' run: | - cargo build --release --manifest-path src/actions/Cargo.toml --bin publish + cargo build --release --manifest-path src/actions/Cargo.toml --bin builder mkdir -p ./builder-bin - cp src/actions/target/release/publish ./builder-bin/builder + cp src/actions/target/release/builder ./builder-bin/builder - name: Run Build run: | chmod +x ./builder-bin/builder - ./builder-bin/builder "${{ steps.meta.outputs.manifest }}" + ./builder-bin/builder "${{ steps.meta.outputs.short_sha }}" - name: Upload uses: https://code.forgejo.org/actions/upload-artifact@v3 with: name: "build-${{ steps.meta.outputs.short_sha }}" - path: "**/artifacts/" \ No newline at end of file + path: "artifacts/"