summaryrefslogtreecommitdiffhomepage
path: root/.github/workflows/raylib-to-itch.yml
blob: 4248e6fc53ddf736ea4a8bddf7cfd56f8b8025a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Raylib to Itch

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3
      with:
        submodules: recursive

    # install asdf
    - name: asdf-install
      run: |
        sudo apt install curl git zip
        git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.10.0
    # install emcc
    - name: install-emscripten
      run: |
        . $HOME/.asdf/asdf.sh
        asdf plugin add emsdk https://github.com/RobLoach/asdf-emsdk.git
        asdf install emsdk
    # compile raylib
    - name: compile-raylib
      run: |
        . $HOME/.asdf/asdf.sh
        mkdir lib && mkdir lib/web
        cd dependency/raylib/src
        make PLATFORM=PLATFORM_WEB -B -e
        cp libraylib.a ../../../lib/web/
    # make
    - name: build
      run: |
        . $HOME/.asdf/asdf.sh
        make web
        cd output/web
        zip game.zip index.*
    # install itch butler
    - name: install-butler
      run: |
        curl -L -o butler.zip  https://broth.itch.ovh/butler/linux-amd64/LATEST/archive/default
        unzip butler.zip
        chmod +x butler
        ./butler -V
    # upload zip
    - name: upload
      env:
        BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
      run: |
        cd output/web
        ./butler login
        ./butler push game.zip tradam/raylib-template-test:html5
        ./butler logout