Skip to content

Commit 80d6ce2

Browse files
committed
ci: Add pack builder
1 parent 943506e commit 80d6ce2

File tree

4 files changed

+886
-3
lines changed

4 files changed

+886
-3
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Bedrock Pack Build
2+
3+
on:
4+
push:
5+
branches: ["**"]
6+
pull_request:
7+
branches: ["**"]
8+
workflow_dispatch:
9+
10+
jobs:
11+
changes:
12+
name: Detect changes
13+
runs-on: ubuntu-latest
14+
outputs:
15+
bedrock: ${{ steps.filter.outputs.bedrock }}
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
- name: Paths filter
22+
id: filter
23+
uses: dorny/paths-filter@v3
24+
with:
25+
filters: |
26+
bedrock:
27+
- 'bedrock/**'
28+
29+
build:
30+
name: Build Bedrock packs
31+
needs: changes
32+
if: >
33+
${{ needs.changes.outputs.bedrock == 'true' ||
34+
(github.event_name == 'push' && contains(github.event.head_commit.message, '(bedrock):')) ||
35+
(github.event_name == 'pull_request' && (contains(github.event.pull_request.title, '(bedrock):') || contains(github.event.pull_request.body, '(bedrock):'))) ||
36+
github.event_name == 'workflow_dispatch' }}
37+
runs-on: ubuntu-latest
38+
steps:
39+
- name: Checkout
40+
uses: actions/checkout@v4
41+
42+
- name: Setup Bun
43+
uses: oven-sh/setup-bun@v1
44+
with:
45+
bun-version: latest
46+
47+
- name: Install dependencies
48+
run: bun install --frozen-lockfile
49+
50+
- name: Build packs (CI mode)
51+
env:
52+
CI: 'true'
53+
# Optional overrides (comma-separated values)
54+
# BEDROCK_BUILDS: 'RTX,VV'
55+
# BEDROCK_SUBPACK_RES: '128,64,32'
56+
# BEDROCK_DRY_RUN: 'false'
57+
run: bun ./src/scripts/build-packs.ts --ci
58+
59+
- name: Upload .mcpack artifacts
60+
if: success()
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: bedrock-mcpacks
64+
path: dist/**/*.mcpack
65+
if-no-files-found: warn
66+
67+
- name: Upload manifests
68+
if: success()
69+
uses: actions/upload-artifact@v4
70+
with:
71+
name: bedrock-manifests
72+
path: |
73+
dist/**/manifest.json
74+
if-no-files-found: warn

bun.lockb

15.3 KB
Binary file not shown.

package.json

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1-
{ "dependencies": { "sharp": "^0.33.3" }, "devDependencies": { "@types/bun": "latest", "@types/node": "^20.11.19" }, "name": "jg-rtx", "module": "index.ts", "type": "module", "peerDependencies": {
2-
"typescript": "^5.0.0"
3-
} }
1+
{
2+
"dependencies": {
3+
"@types/adm-zip": "^0.5.7",
4+
"@types/minimist": "^1.2.5",
5+
"adm-zip": "^0.5.16",
6+
"globby": "^14.1.0",
7+
"jszip": "3.10.1",
8+
"minimist": "^1.2.8",
9+
"prompts": "^2.4.2",
10+
"sharp": "^0.33.3"
11+
},
12+
"devDependencies": {
13+
"@types/bun": "latest",
14+
"@types/node": "^20.11.19"
15+
},
16+
"name": "jg-rtx",
17+
"module": "index.ts",
18+
"type": "module",
19+
"peerDependencies": {
20+
"typescript": "^5.0.0"
21+
}
22+
}

0 commit comments

Comments
 (0)