mirror of
https://github.com/Nostalgica-Reverie/Content-Monorepo.git
synced 2026-05-09 00:24:15 +00:00
29 lines
829 B
YAML
29 lines
829 B
YAML
name: Build Resource Pack
|
|
on:
|
|
push:
|
|
branches: [ "main" ]
|
|
paths:
|
|
- 'resourcepacks/**'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: technocality
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
with:
|
|
fetch-depth: 2
|
|
|
|
- name: Build
|
|
id: build
|
|
run: |
|
|
pack=$(git diff --name-only HEAD~1 HEAD | grep '^resourcepacks/' | sed 's|resourcepacks/[^/]*/\([^/]*\)/.*|\1|' | sort -u | head -1)
|
|
dir=$(find ./resourcepacks -type d -name "$pack" | head -1)
|
|
echo "pack=$pack" >> $GITHUB_OUTPUT
|
|
cd "$dir" && python3 -m zipfile -c "$OLDPWD/$pack.zip" *
|
|
|
|
- name: Upload
|
|
uses: https://code.forgejo.org/actions/upload-artifact@v3
|
|
with:
|
|
name: ${{ steps.build.outputs.pack }}
|
|
path: ${{ steps.build.outputs.pack }}.zip |