|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + |
| 6 | + |
| 7 | +jobs: |
| 8 | + build_linux: |
| 9 | + runs-on: ubuntu-latest |
| 10 | + steps: |
| 11 | + - uses: actions/checkout@v2 |
| 12 | + with: |
| 13 | + fetch-depth: 1 |
| 14 | + |
| 15 | + - name: Install dependencies |
| 16 | + run: | |
| 17 | + sudo apt update |
| 18 | + sudo apt install -y libsfml-dev |
| 19 | + |
| 20 | + - name: Build |
| 21 | + run: | |
| 22 | + mkdir build/ && cd build/ |
| 23 | + cmake -DCMAKE_BUILD_TYPE=Release .. |
| 24 | + make -j4 |
| 25 | + - uses: actions/upload-artifact@v4 |
| 26 | + with: |
| 27 | + name: SimpleNES-linux |
| 28 | + path: build/SimpleNES |
| 29 | + |
| 30 | + |
| 31 | + build_macos: |
| 32 | + runs-on: macos-latest |
| 33 | + steps: |
| 34 | + - uses: actions/checkout@v2 |
| 35 | + with: |
| 36 | + fetch-depth: 1 |
| 37 | + |
| 38 | + - name: Install dependencies |
| 39 | + run: | |
| 40 | + brew install sfml@2 |
| 41 | + brew link --force --overwrite sfml@2 |
| 42 | + |
| 43 | + - name: Build |
| 44 | + run: | |
| 45 | + mkdir build/ && cd build/ |
| 46 | + cmake -DCMAKE_BUILD_TYPE=Release .. |
| 47 | + make -j4 |
| 48 | + |
| 49 | + - uses: actions/upload-artifact@v4 |
| 50 | + with: |
| 51 | + name: SimpleNES-macos |
| 52 | + path: build/SimpleNES |
| 53 | + |
| 54 | + build_windows: |
| 55 | + runs-on: windows-latest |
| 56 | + steps: |
| 57 | + - uses: actions/checkout@v2 |
| 58 | + with: |
| 59 | + fetch-depth: 1 |
| 60 | + |
| 61 | + - name: Install dependencies |
| 62 | + run: | |
| 63 | + $manifest = @' |
| 64 | + { |
| 65 | + "dependencies": [ "sfml" ], |
| 66 | + "builtin-baseline": "df6921c0b6cdf95269a4a3093e267b59e4bf0f5b", |
| 67 | + "overrides": [ |
| 68 | + { "name": "sfml", "version": "2.6.2" } |
| 69 | + ] |
| 70 | + } |
| 71 | + '@ |
| 72 | + Add-Content ./vcpkg.json $manifest |
| 73 | + vcpkg install |
| 74 | + |
| 75 | + - name: Build |
| 76 | + run: | |
| 77 | + mkdir build/ && cd build/ |
| 78 | + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake .. |
| 79 | + cmake --build . --config Release |
| 80 | + |
| 81 | + - uses: actions/upload-artifact@v4 |
| 82 | + with: |
| 83 | + name: SimpleNES-win.exe |
| 84 | + path: build/Release/SimpleNES.exe |
| 85 | + |
| 86 | + release: |
| 87 | + runs-on: ubuntu-latest |
| 88 | + needs: [build_linux, build_macos, build_windows] |
| 89 | + steps: |
| 90 | + - uses: actions/download-artifact@v4 |
| 91 | + with: |
| 92 | + path: artifacts |
| 93 | + merge-multiple: true |
| 94 | + - name: Display structure of downloaded files |
| 95 | + run: ls -R artifacts |
| 96 | + - name: Release |
| 97 | + uses: softprops/action-gh-release@v2 |
| 98 | + with: |
| 99 | + files: artifacts/* |
| 100 | + |
0 commit comments