Skip to content

Randomize car starting velocity #8

Randomize car starting velocity

Randomize car starting velocity #8

Workflow file for this run

name: Build for various platforms and upload to itch.io
on:
push:
branches: [build]
workflow_dispatch:
jobs:
build:
name: Build for ${{matrix.config.name}}
runs-on: ${{matrix.config.os}}
strategy:
fail-fast: false
matrix:
config:
- {
name: linux-gnu,
exe: CodenamePedestrian,
out: CodenamePedestrian,
os: ubuntu-latest,
cxx: g++,
cc: gcc,
}
- {
name: windows-msvc,
exe: Debug/CodenamePedestrian.exe,
out: CodenamePedestrian.exe,
os: windows-latest,
cxx: cl,
cc: cl,
}
steps:
- name: Install dependencies (Ubuntu)
if: matrix.config.os == 'ubuntu-latest'
run: |
sudo apt update
sudo apt install cmake gcc g++ libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev libgl-dev
- name: Checkout
uses: actions/checkout@v4
- name: Configure CMake with selected compiler family
run: cmake -B build -S ${{github.workspace}} -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=${{matrix.config.cc}} -DCMAKE_CXX_COMPILER=${{matrix.config.cxx}}
- name: Build with CMake
run: cmake --build build -j 4
- name: Assemble dist-files
run: |
mkdir -p dist-${{matrix.config.name}}
cp -r assets dist-${{matrix.config.name}}
cp build/${{matrix.config.exe}} dist-${{matrix.config.name}}/${{matrix.config.out}}
- name: Tar the distribution
run: tar -cvf ${{matrix.config.name}}.tar dist-${{matrix.config.name}}
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: ${{matrix.config.name}}
path: ${{matrix.config.name}}.tar
upload:
name: Upload channel ${{matrix.distribution}} to itch.io
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
distribution: [linux-gnu, windows-msvc]
steps:
- name: Download the distribution
uses: actions/download-artifact@v4
with:
name: ${{matrix.distribution}}
- name: Unpack the distribution
run: |
tar -xf ${{matrix.distribution}}.tar
- name: Upload to itch.io
uses: manleydev/butler-publish-itchio-action@master
env:
BUTLER_CREDENTIALS: ${{ secrets.BUTLER_CREDENTIALS }}
CHANNEL: ${{matrix.distribution}}
ITCH_GAME: codename-pedestrian
ITCH_USER: nonk123
PACKAGE: dist-${{matrix.distribution}}