|
| 1 | +name: CI |
| 2 | + |
| 3 | +# Controls when the workflow will run |
| 4 | +on: |
| 5 | + create: |
| 6 | + |
| 7 | + # Triggers the workflow on push or pull request events but only for the master branch |
| 8 | + push: |
| 9 | + branches: [ master ] |
| 10 | + |
| 11 | + pull_request: |
| 12 | + branches: [ master ] |
| 13 | + |
| 14 | + # Allows you to run this workflow manually from the Actions tab |
| 15 | + workflow_dispatch: |
| 16 | + |
| 17 | +jobs: |
| 18 | + Build: |
| 19 | + runs-on: ${{ matrix.os }} |
| 20 | + strategy: |
| 21 | + matrix: |
| 22 | + os: [macos-latest, ubuntu-latest, windows-latest] |
| 23 | + |
| 24 | + # Steps represent a sequence of tasks that will be executed as part of the job |
| 25 | + steps: |
| 26 | + |
| 27 | + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it |
| 28 | + - uses: actions/checkout@v2 |
| 29 | + |
| 30 | + - name: Get Submodules |
| 31 | + run: git submodule update --init --recursive |
| 32 | + |
| 33 | + - name: Build |
| 34 | + run: | |
| 35 | + if [ "$RUNNER_OS" == "Windows" ]; then |
| 36 | + ./ci-build.cmd |
| 37 | + else |
| 38 | + ./ci-build.sh |
| 39 | + fi |
| 40 | + shell: bash |
| 41 | + |
| 42 | + - name: Upload x64 Release |
| 43 | + uses: actions/upload-artifact@v2 |
| 44 | + if: matrix.os == 'windows-latest' |
| 45 | + with: |
| 46 | + name: win-x64 |
| 47 | + path: cimgui\build\x64\Release\cimgui.dll |
| 48 | + |
| 49 | + - name: Upload x86 Release |
| 50 | + uses: actions/upload-artifact@v2 |
| 51 | + if: matrix.os == 'windows-latest' |
| 52 | + with: |
| 53 | + name: win-x86 |
| 54 | + path: cimgui\build\x86\Release\cimgui.dll |
| 55 | + |
| 56 | + - name: Upload Linux Release |
| 57 | + uses: actions/upload-artifact@v2 |
| 58 | + if: matrix.os == 'ubuntu-latest' |
| 59 | + with: |
| 60 | + name: linux-x64 |
| 61 | + path: cimgui/build/Release/cimgui.so |
| 62 | + |
| 63 | + - name: Upload MacOS Release |
| 64 | + uses: actions/upload-artifact@v2 |
| 65 | + if: matrix.os == 'macos-latest' |
| 66 | + with: |
| 67 | + name: osx-x64 |
| 68 | + path: cimgui/build/Release/cimgui.dylib |
| 69 | + |
| 70 | + - name: Upload Definitions Json File |
| 71 | + uses: actions/upload-artifact@v2 |
| 72 | + if: matrix.os == 'windows-latest' |
| 73 | + with: |
| 74 | + name: JsonFiles |
| 75 | + path: cimgui\generator\output\definitions.json |
| 76 | + |
| 77 | + - name: Upload structs_and_enums Json File |
| 78 | + uses: actions/upload-artifact@v2 |
| 79 | + if: matrix.os == 'windows-latest' |
| 80 | + with: |
| 81 | + name: JsonFiles |
| 82 | + path: cimgui\generator\output\structs_and_enums.json |
| 83 | + |
| 84 | + CreateReleaseOnTagCreate: |
| 85 | + runs-on: ubuntu-latest |
| 86 | + needs: [Build] |
| 87 | + if: startsWith(github.ref, 'refs/tags/') |
| 88 | + steps: |
| 89 | + - name: Download Artifacts |
| 90 | + uses: actions/download-artifact@v2 |
| 91 | + |
| 92 | + - name: Rename win-x64 and win-x86 artifacts |
| 93 | + run: | |
| 94 | + mv win-x64/cimgui.dll win-x64/cimgui.win-x64.dll |
| 95 | + mv win-x86/cimgui.dll win-x86/cimgui.win-x86.dll |
| 96 | +
|
| 97 | + - name: Release |
| 98 | + uses: softprops/action-gh-release@v1 |
| 99 | + with: |
| 100 | + files: | |
| 101 | + win-x64/* |
| 102 | + win-x86/* |
| 103 | + JsonFiles/* |
| 104 | + linux-x64/* |
0 commit comments