File: build.yaml

package info (click to toggle)
numptyphysics 0.3.10-0.2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,788 kB
  • sloc: cpp: 21,126; ansic: 6,298; makefile: 170; python: 135
file content (85 lines) | stat: -rw-r--r-- 3,093 bytes parent folder | download
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Build from source

on:
  push:
    branches:
      - master
    tags:
      - '**'
  pull_request:
    branches:
      - master

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        platform:
          - sdl1
          - sdl2
          - emscripten
          - mingw
    steps:
      - uses: actions/checkout@v2
      - uses: mymindstorm/setup-emsdk@v9
        if: matrix.platform == 'emscripten'
      - name: Install dependencies
        run: |
            sudo apt update
            sudo apt install -y \
                libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev libegl1-mesa-dev libgles2-mesa-dev \
                libsdl1.2-dev libglib2.0-dev libgl1-mesa-dev
      - name: Install MinGW build tools and dependencies
        if: matrix.platform == 'mingw'
        run: |
            sudo apt update
            sudo apt install -y \
                gcc-mingw-w64-i686 g++-mingw-w64-i686
            wget https://galogen.gpfault.net/releases/1.0/galogen-1.0-linux-x86_64.zip
            unzip galogen-1.0-linux-x86_64.zip
            chmod +x galogen
            ./galogen gl.xml --ver 3.0 --profile compatibility
            mv gl.[ch] external/glaserl
            wget http://libsdl.org/release/SDL2-devel-2.0.14-mingw.tar.gz
            tar xvf SDL2-devel-2.0.14-mingw.tar.gz
            wget https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-devel-2.0.15-mingw.tar.gz
            tar xvf SDL2_ttf-devel-2.0.15-mingw.tar.gz
            wget https://www.libsdl.org/projects/SDL_image/release/SDL2_image-devel-2.0.5-mingw.tar.gz
            tar xvf SDL2_image-devel-2.0.5-mingw.tar.gz

            cp /usr/lib/gcc/i686-w64-mingw32/*-win32/libgcc_s_sjlj-1.dll .
            cp /usr/lib/gcc/i686-w64-mingw32/*-win32/libstdc++-6.dll .
            cp /usr/i686-w64-mingw32/lib/libwinpthread-1.dll .
            rm -f SDL2_image-2.0.5/i686-w64-mingw32/bin/zlib1.dll
            cp -v SDL2*/i686-w64-mingw32/bin/*.dll .
      - name: Build from source
        run: |
            WRAPPER_SCRIPT=""
            if [[ "${{ matrix.platform }}" == "emscripten" ]]; then
                WRAPPER_SCRIPT=emmake
            fi
            $WRAPPER_SCRIPT make PLATFORM=${{ matrix.platform }} V=1
      - name: Package (mingw)
        if: matrix.platform == 'mingw'
        run: |
            mkdir -p dist
            zip -r dist/numptyphysics-win32 numptyphysics.exe data *.dll README.md AUTHORS COPYING
      - name: Package (emscripten)
        if: matrix.platform == 'emscripten'
        run: |
            mkdir -p dist
            zip -r dist/numptyphysics-html5 numptyphysics.{html,js,wasm}
      - uses: actions/upload-artifact@v2
        with:
          name: build-result
          path: dist/*
          if-no-files-found: ignore
      - name: Upload Release
        if: startsWith(github.ref, 'refs/tags/')
        run: |
            gh release create "${GITHUB_REF#refs/tags/}" || true
            gh release upload "${GITHUB_REF#refs/tags/}" dist/* || true
        env:
            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}