Skip to content

Commit

Permalink
Add easy-compile workflow and release scripts. Modify readme and upda…
Browse files Browse the repository at this point in the history
…te run script.
  • Loading branch information
juvinious committed Mar 5, 2024
1 parent 3f16e75 commit f9bdbd0
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/compile-steam.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: steam cross compile build (sniper)

on:
push

jobs:
build:
name: Compile
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Run build
run: |
./easy-compile-docker-steam
- name: Run Release
if: startsWith(github.ref, 'refs/tags/')
run: ./release/release-steam

- name: Archive Folder
uses: actions/upload-artifact@v4
with:
name: artifact
path: ${{github.workspace}}/*.zip

publish-release:
needs: build
runs-on: ubuntu-latest

steps:
- name: Download Artifact
if: startsWith(github.ref, 'refs/tags/')
uses: actions/download-artifact@v4
with:
name: artifact
path: ${{github.workspace}}

- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: ${{ github.workspace }}/*.zip
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Paintown is a 2-d fighting game that is similar in style to Streets of Rage. Pai
![Mac Arm Build](https://github.com/kazzmir/paintown/actions/workflows/compile-mac-arm.yml/badge.svg)
![Mingw Cross-Compile Build](https://github.com/kazzmir/paintown/actions/workflows/mingw-cross.yml/badge.svg)
![Devkitpro Cross-Compile Build](https://github.com/kazzmir/paintown/actions/workflows/compile-dkp.yml/badge.svg)
![Steam Cross-Compile Build](https://github.com/kazzmir/paintown/actions/workflows/compile-steam.yml/badge.svg)

## Releases

Expand Down
11 changes: 11 additions & 0 deletions easy-compile-docker-steam
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash -e

docker build -t paintown-steam-build -f docker/Dockerfile.steam .
mkdir -p ${PWD}/steam-bin
docker run --rm -iv${PWD}:/paintown-bin paintown-steam-build sh -s <<EOF
chown $(id -u):$(id -g) /build/build-debug/paintown
cp -a /build/build-debug/paintown /paintown-bin/steam-bin
if [ -z /build/build-debug/src/test ]; then
find /build/build-debug/src/test -type f -name \*.exe -exec sh -c "chown $(id -u):$(id -g) {}; cp -a {} /paintown-bin/steam-bin" \;
fi
EOF
14 changes: 14 additions & 0 deletions misc/steam/steam-run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

PAINTOWN_HOME=/home/deck/devkit-game/Paintown

cd ${PAINTOWN_HOME}

if [ ! -z data ]; then
wget -qO- https://github.com/kazzmir/paintown/releases/download/v3.6.0/data-3.6.0.zip -O temp.zip && unzip -qo temp.zip && rm temp.zip
fi

/home/deck/.steam/root/ubuntu12_64/steam-runtime-sniper/run \
-- \
${PAINTOWN_HOME}/paintown \
-d ${PAINTOWN_HOME}/data
19 changes: 19 additions & 0 deletions release/release-steam
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
EXEDIR="$SCRIPT_DIR/.."
EXE=paintown

# inside tmp
cd $SCRIPT_DIR
rm -rf tmp && mkdir tmp && cd tmp

# copy executable
cp $EXEDIR/steam-bin/$EXE .
# Copy launcher
cp $EXEDIR/misc/steam/steam-run.sh

# packaging
ARCH=x86-64
OS=linux-steam
zip -r $EXEDIR/$EXE-$OS-$ARCH.zip .

0 comments on commit f9bdbd0

Please sign in to comment.