Call asset script directly with output path #85
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
language: [ no, sv, da, nl ] | |
steps: | |
- name: Checkout project | |
uses: actions/checkout@v4 | |
- name: Use Node.js 14.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 14.x | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9 | |
- name: Cache data | |
uses: actions/cache@v4 | |
id: iso | |
with: | |
path: iso/mullebil_${{ matrix.language }}.iso | |
key: game-iso-${{ matrix.language }}-${{ hashFiles('iso/mullebil_*.iso') }} | |
restore-keys: game-iso-${{ matrix.language }}- | |
- name: Cache binaries | |
uses: actions/cache@v4 | |
id: bin | |
with: | |
path: bin | |
key: bin-${{ hashFiles('bin/*') }} | |
restore-keys: bin- | |
- name: Cache APT packages | |
uses: actions/cache@v4 | |
id: apt | |
with: | |
path: /tmp/apt | |
key: apt-${{ hashFiles('/tmp/apt/pkgcache.bin') }} | |
restore-keys: apt- | |
- name: Get npm cache directory | |
id: npm-cache-dir | |
run: | | |
echo "::set-output name=dir::$(npm config get cache)" | |
- name: Cache NPM packages | |
uses: actions/cache@v2 | |
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true' | |
with: | |
path: ${{ steps.npm-cache-dir.outputs.dir }} | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install APT packages | |
run: | | |
mkdir -p /tmp/apt/archives | |
sudo cp -r /tmp/apt /var/cache | |
sudo apt-get update | |
sudo apt-get install ffmpeg optipng | |
sudo cp /var/cache/apt/*.bin /tmp/apt | |
sudo cp -r /var/cache/apt/archives/*.deb /tmp/apt/archives | |
- run: npm install | |
- run: pip install -r requirements.txt | |
- name: Build webpack | |
run: python build_scripts/build.py webpack-prod | |
- name: Build phaser | |
run: python build_scripts/build.py phaser | |
- name: Download game | |
run: python build_scripts/build.py ${{ matrix.language }} download | |
- name: Extract scores | |
run: python build_scripts/build.py ${{ matrix.language }} scores | |
- name: Build HTML and CSS | |
run: python build_scripts/build.py ${{ matrix.language }} html_css | |
- name: Build topography | |
run: python build_scripts/build.py ${{ matrix.language }} topography | |
- name: Build assets | |
run: python assets.py 0 ./dist/assets | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: dist-${{ matrix.language }} | |
path: dist |