diff --git a/.github/workflows/giantdays_ci_build.yml b/.github/workflows/giantdays_ci_build.yml new file mode 100644 index 0000000000..2f41da0c8d --- /dev/null +++ b/.github/workflows/giantdays_ci_build.yml @@ -0,0 +1,86 @@ +# performs CI builds using compose.py from +# https://github.com/CleverRaven/Cataclysm-DDA +# +# This action is triggerd by any PR against the master branch as well +# as on any push to the master branch itself +# that changes any file in gfx/RetroDays folder +name: GiantDays composer + +env: + TILESET: GiantDays + COMPOSE_ARGS: --use-all + BUILD_DIR: build + +on: + push: + branches: + - master + paths: + - 'gfx/GiantDays/**' + - '.github/workflows/giantdays_ci_build.yml' + pull_request: + branches: + - master + paths: + - 'gfx/GiantDays/**' + - '.github/workflows/giantdays_ci_build.yml' + +jobs: + build: + name: CI Build + runs-on: ubuntu-latest + steps: + - name: Install Dependencies + uses: awalsh128/cache-apt-pkgs-action@v1 + with: + packages: musl python3 python3-pip libvips42 + + # re-installing libvips; caching it won't set it up the way we need it + # still cache it because we'll make it work somehow + - run: sudo apt-get update; sudo apt-get install libvips42 + - run: pip3 install pyvips + + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Build + id: build + run: | + mkdir "$BUILD_DIR" + wget -q -P "$BUILD_DIR" https://raw.githubusercontent.com/CleverRaven/Cataclysm-DDA/master/tools/gfx_tools/compose.py \ + || echo "Error: Failed to get compose.py" + + python3 "$BUILD_DIR/compose.py" --feedback CONCISE --loglevel INFO $COMPOSE_ARGS "gfx/$TILESET" "$BUILD_DIR" + [ -f "gfx/$TILESET/fallback.png" ] && cp "gfx/$TILESET/fallback.png" "$BUILD_DIR/" + + artifact_name="$TILESET-dev-git-${GITHUB_SHA::7}" + + mkdir "$artifact_name" + mv "${BUILD_DIR}"/*.png "$artifact_name" + cp "$BUILD_DIR/tile_config.json" "$artifact_name" + cp "gfx/$TILESET/tileset.txt" "$artifact_name" + + echo "ARTIFACT-NAME=$artifact_name" >> $GITHUB_OUTPUT + + - name: Upload Artifacts + uses: actions/upload-artifact@v3.1.2 + with: + name: ${{ steps.build.outputs.ARTIFACT-NAME }} + path: ${{ steps.build.outputs.ARTIFACT-NAME }} + + - name: Compare IDs with ${{ github.base_ref }} + id: compare + if: github.base_ref + run: | + echo "Switching to the target branch ${{ github.base_ref }} to get differences between ID lists" + git fetch --no-tags --prune --no-recurse-submodules --depth=1 origin +${{ github.base_ref }} + git checkout origin/${{ github.base_ref }} + + mkdir "$BUILD_DIR/base_json/" + python3 "$BUILD_DIR/compose.py" $COMPOSE_ARGS --only-json "gfx/$TILESET" "$BUILD_DIR/base_json/" + + wget -q -P "$BUILD_DIR" https://raw.githubusercontent.com/CleverRaven/Cataclysm-DDA/master/tools/gfx_tools/list_tileset_ids.py \ + || echo "Error: Failed to get list_tileset_ids.py" + + echo -e "\nDifferences in IDs:" + (diff -u0 <(python3 "$BUILD_DIR/list_tileset_ids.py" "$BUILD_DIR/base_json/") <(python3 "$BUILD_DIR/list_tileset_ids.py" "$BUILD_DIR/")) | tail -n +3 diff --git a/.github/workflows/make_release.yml b/.github/workflows/make_release.yml index 084f915a87..32ec1127e2 100644 --- a/.github/workflows/make_release.yml +++ b/.github/workflows/make_release.yml @@ -73,6 +73,10 @@ jobs: artifact: RetroDaysTileset tileset_dir: gfx/Retrodays compose_args: --use-all + - name: GiantDays + artifact: GiantDays + tileset_dir: gfx/GiantDays + compose_args: --use-all - name: SmashButton_iso artifact: SmashButton_iso tileset_dir: gfx/HitButton_iso