|
| 1 | +name: CI build |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + tags: ['v*'] |
| 7 | + |
| 8 | +jobs: |
| 9 | + build-apple-android: |
| 10 | + runs-on: macos-15 |
| 11 | + steps: |
| 12 | + - name: Install dependencies |
| 13 | + run: | |
| 14 | + brew update |
| 15 | + brew install conan |
| 16 | + brew cleanup |
| 17 | +
|
| 18 | + - name: Set up Conan |
| 19 | + run: | |
| 20 | + conan profile detect |
| 21 | +
|
| 22 | + - name: Checkout source |
| 23 | + uses: actions/checkout@v4 |
| 24 | + |
| 25 | + - name: Build iOS, Android, macOS |
| 26 | + run: | |
| 27 | + ./build.sh ios android macos |
| 28 | +
|
| 29 | + - name: Upload artifacts |
| 30 | + uses: actions/upload-artifact@v4 |
| 31 | + with: |
| 32 | + name: package-apple-android |
| 33 | + path: | |
| 34 | + include |
| 35 | + lib |
| 36 | +
|
| 37 | + build-linux: |
| 38 | + runs-on: ubuntu-latest |
| 39 | + steps: |
| 40 | + - name: Checkout source |
| 41 | + uses: actions/checkout@v4 |
| 42 | + |
| 43 | + - name: Build Linux (Docker) |
| 44 | + run: | |
| 45 | + ./build.sh linux |
| 46 | +
|
| 47 | + - name: Upload artifacts |
| 48 | + uses: actions/upload-artifact@v4 |
| 49 | + with: |
| 50 | + name: package-linux |
| 51 | + path: | |
| 52 | + lib |
| 53 | +
|
| 54 | + build-windows: |
| 55 | + runs-on: windows-latest |
| 56 | + steps: |
| 57 | + - name: Install Conan |
| 58 | + run: pip install conan |
| 59 | + |
| 60 | + - name: Set up Conan |
| 61 | + run: conan profile detect |
| 62 | + |
| 63 | + - name: Checkout source |
| 64 | + uses: actions/checkout@v4 |
| 65 | + |
| 66 | + - name: Build Windows |
| 67 | + shell: bash |
| 68 | + run: | |
| 69 | + ./build.sh windows |
| 70 | +
|
| 71 | + - name: Upload artifacts |
| 72 | + uses: actions/upload-artifact@v4 |
| 73 | + with: |
| 74 | + name: package-windows |
| 75 | + path: | |
| 76 | + lib |
| 77 | +
|
| 78 | + package: |
| 79 | + needs: [build-apple-android, build-linux, build-windows] |
| 80 | + runs-on: ubuntu-latest |
| 81 | + steps: |
| 82 | + - name: Download Apple/Android artifacts |
| 83 | + uses: actions/download-artifact@v4 |
| 84 | + with: |
| 85 | + name: package-apple-android |
| 86 | + path: output |
| 87 | + |
| 88 | + - name: Download Linux artifacts |
| 89 | + uses: actions/download-artifact@v4 |
| 90 | + with: |
| 91 | + name: package-linux |
| 92 | + path: output |
| 93 | + |
| 94 | + - name: Download Windows artifacts |
| 95 | + uses: actions/download-artifact@v4 |
| 96 | + with: |
| 97 | + name: package-windows |
| 98 | + path: output |
| 99 | + |
| 100 | + - name: Create combined package |
| 101 | + run: | |
| 102 | + cd output |
| 103 | + zip -r ../package.zip include lib |
| 104 | +
|
| 105 | + - name: Upload combined package |
| 106 | + uses: actions/upload-artifact@v4 |
| 107 | + with: |
| 108 | + name: package |
| 109 | + path: package.zip |
| 110 | + |
| 111 | + release: |
| 112 | + needs: [package] |
| 113 | + if: startsWith(github.ref, 'refs/tags/v') |
| 114 | + runs-on: ubuntu-latest |
| 115 | + permissions: |
| 116 | + contents: write |
| 117 | + steps: |
| 118 | + - name: Download package |
| 119 | + uses: actions/download-artifact@v4 |
| 120 | + with: |
| 121 | + name: package |
| 122 | + |
| 123 | + - name: Create GitHub Release |
| 124 | + env: |
| 125 | + GH_TOKEN: ${{ github.token }} |
| 126 | + run: | |
| 127 | + gh release create "${{ github.ref_name }}" package.zip \ |
| 128 | + --repo "${{ github.repository }}" \ |
| 129 | + --title "${{ github.ref_name }}" \ |
| 130 | + --generate-notes |
0 commit comments