Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export_assets: py -> sh #610

Merged
merged 1 commit into from
Aug 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Install Python
uses: actions/setup-python@v2

- name: Install rust
uses: actions-rs/toolchain@v1
with:
Expand All @@ -104,6 +101,7 @@ jobs:
elif [ "$RUNNER_OS" == "Windows" ]; then
curl -sL https://github.com/RazrFalcon/resvg/releases/download/v0.11.0/viewsvg-win.zip -O
7z x viewsvg-win.zip
mv resvg ~/.cargo/bin
else
echo "$RUNNER_OS not supported"
exit 1
Expand All @@ -112,7 +110,7 @@ jobs:
- name: Export assets
shell: bash
run: |
python ./utils/assets_export.py
./utils/assets_export.sh
ls -lR assets

- name: Build
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ jobs:
run: |
sudo apt-get -yq --no-install-suggests --no-install-recommends install libx11-dev libxi-dev libgl1-mesa-dev

- name: Install Python
uses: actions/setup-python@v2

- name: Install rust
uses: actions-rs/toolchain@v1
with:
Expand All @@ -77,7 +74,7 @@ jobs:
- name: Export assets
shell: bash
run: |
python ./utils/assets_export.py
./utils/assets_export.sh
ls -lR assets

- name: Build
Expand Down Expand Up @@ -143,14 +140,11 @@ jobs:
profile: minimal
override: true

- name: Install Python
uses: actions/setup-python@v2

- name: Install resvg
run: cargo install resvg

- name: Export assets
run: python ./utils/assets_export.py
run: ./utils/assets_export.sh

- name: Build
run: ./utils/wasm/build.sh
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ Install all [miniquad's system dependencies][mq_sys_deps].

```bash
cargo install resvg
./utils/assets_export.py
./utils/assets_export.sh
cargo run
```

Expand All @@ -145,7 +145,7 @@ cargo run

```bash
cargo install resvg
./utils/assets_export.py
./utils/assets_export.sh
rustup target add wasm32-unknown-unknown
./utils/wasm/build.sh
cargo install basic-http-server
Expand Down
63 changes: 63 additions & 0 deletions assets_src/export_ids
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
tile
tile_rocks
poison_cloud
imp
imp_toxic
imp_summoner
imp_summoner_cast
imp_bomber
imp_bomber_throw
grass
shadow
fire
boulder
bomb
bomb_fire
bomb_poison
bomb_demonic
explosion_ground_mark
blood
slash
smash
pierce
claw
spike_trap
dot
selection
white_hex
hammerman
heavy_hammerman
spearman
elite_spearman
heavy_spearman
alchemist
alchemist_throw
alchemist_heal
healer
healer_throw
healer_heal
firer
firer_throw
swordsman
elite_swordsman
elite_swordsman_rage
heavy_swordsman
effect_poison
effect_stun
effect_bloodlust
icon_ability_club
icon_ability_knockback
icon_ability_jump
icon_ability_dash
icon_ability_rage
icon_ability_heal
icon_ability_bomb_push
icon_ability_bomb
icon_ability_bomb_fire
icon_ability_bomb_poison
icon_ability_bomb_demonic
icon_ability_summon
icon_ability_bloodlust
icon_info
icon_end_turn
icon_menu
91 changes: 0 additions & 91 deletions utils/assets_export.py

This file was deleted.

15 changes: 15 additions & 0 deletions utils/assets_export.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

# Convert one `.svg` file to many `png`s.

EXPORT_IDS="assets_src/export_ids"
INPUT_FILE="assets_src/atlas.svg"
OUT_DIR="assets/img"

mkdir -p $OUT_DIR

cat $EXPORT_IDS | tr -d '\r' | while read -r id
do
echo Exporting "$id"
resvg --zoom=12 --export-id="$id" $INPUT_FILE "$OUT_DIR/$id.png"
done