From 7fbb9a9da6c8e48d45a3929ce369bce0a4d40608 Mon Sep 17 00:00:00 2001 From: Jikoo Date: Fri, 12 Jul 2024 11:58:36 -0400 Subject: [PATCH] Only build resource pack on change/release --- .github/workflows/ci.yml | 9 ++------- .github/workflows/draft_release.yml | 10 ++++++++-- .github/workflows/resource_pack_ci.yml | 24 ++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/resource_pack_ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 168cc55e..7c4f89bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,8 @@ on: - 'master' tags-ignore: - '**' + paths-ignore: + - resource-pack/** # Enable running CI via other Actions, i.e. for drafting releases and handling PRs. workflow_call: @@ -41,10 +43,3 @@ jobs: with: name: api path: ./api/target/openinvapi*.jar - - name: Build resource pack - id: upload-resource-pack - uses: actions/upload-artifact@v4 - with: - name: openinv-legibility-pack - path: ./resource-pack/ - compression-level: 9 diff --git a/.github/workflows/draft_release.yml b/.github/workflows/draft_release.yml index 364186a6..d62e39b8 100644 --- a/.github/workflows/draft_release.yml +++ b/.github/workflows/draft_release.yml @@ -20,12 +20,18 @@ jobs: - name: Set Release Variables run: bash ./scripts/set_release_env.sh - - name: Download Artifact + - name: Download build uses: actions/download-artifact@v4 with: name: dist path: dist + - name: Package resource pack + run: |- + pushd resource-pack + zip -r ../dist/openinv-legibility-pack.zip . + popd + - name: Create Release id: create-release uses: softprops/action-gh-release@v2.0.6 @@ -36,4 +42,4 @@ jobs: body: ${{ env.GENERATED_CHANGELOG }} draft: true prerelease: false - files: ./dist/OpenInv.jar + files: ./dist/** diff --git a/.github/workflows/resource_pack_ci.yml b/.github/workflows/resource_pack_ci.yml new file mode 100644 index 00000000..557701ac --- /dev/null +++ b/.github/workflows/resource_pack_ci.yml @@ -0,0 +1,24 @@ +name: Resource Pack CI + +on: + push: + branches: + - 'master' + tags-ignore: + - '**' + paths: + - resource-pack/** + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Build resource pack + id: upload-resource-pack + uses: actions/upload-artifact@v4 + with: + name: openinv-legibility-pack + path: ./resource-pack/ + compression-level: 9