|
| 1 | +name: Build |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + |
| 6 | +jobs: |
| 7 | + build-linux-amd64: |
| 8 | + runs-on: ubuntu-latest |
| 9 | + |
| 10 | + outputs: |
| 11 | + bot-artifact: ${{ steps.upload.outputs.bot }} |
| 12 | + web-artifact: ${{ steps.upload.outputs.web }} |
| 13 | + |
| 14 | + steps: |
| 15 | + - name: Checkout repository |
| 16 | + uses: actions/checkout@v3 |
| 17 | + with: |
| 18 | + submodules: recursive |
| 19 | + |
| 20 | + - name: Install dependencies |
| 21 | + run: | |
| 22 | + sudo apt-get update |
| 23 | + sudo apt-get install -y \ |
| 24 | + build-essential cmake tar pkg-config \ |
| 25 | + libmysqlclient-dev zlib1g-dev |
| 26 | +
|
| 27 | + - name: Configure project |
| 28 | + run: | |
| 29 | + mkdir -p build |
| 30 | + cd build |
| 31 | + cmake -DUSE_TLS=1 -DCMAKE_BUILD_TYPE=Release .. |
| 32 | +
|
| 33 | + - name: Build project |
| 34 | + run: | |
| 35 | + cd build |
| 36 | + make |
| 37 | +
|
| 38 | + - name: Generate Lua pages |
| 39 | + run: | |
| 40 | + cd build |
| 41 | + cmake --build . --target generate_lua_pages |
| 42 | +
|
| 43 | + - name: Archive bot |
| 44 | + run: | |
| 45 | + mkdir -p artifacts |
| 46 | + tar -czf artifacts/bot-amd64.tar.gz -C build/bot/bin . |
| 47 | +
|
| 48 | + - name: Archive web |
| 49 | + run: | |
| 50 | + tar -czf artifacts/web-amd64.tar.gz -C www . |
| 51 | +
|
| 52 | + - name: Upload artifacts |
| 53 | + id: upload |
| 54 | + uses: actions/upload-artifact@v4 |
| 55 | + with: |
| 56 | + name: build-artifacts-amd64 |
| 57 | + path: artifacts/ |
| 58 | + |
| 59 | + build-linux-arm64: |
| 60 | + runs-on: ubuntu-24.04-arm |
| 61 | + |
| 62 | + outputs: |
| 63 | + bot-artifact: ${{ steps.upload.outputs.bot }} |
| 64 | + web-artifact: ${{ steps.upload.outputs.web }} |
| 65 | + |
| 66 | + steps: |
| 67 | + - name: Checkout repository |
| 68 | + uses: actions/checkout@v3 |
| 69 | + with: |
| 70 | + submodules: recursive |
| 71 | + |
| 72 | + - name: Install dependencies |
| 73 | + run: | |
| 74 | + sudo apt-get update |
| 75 | + sudo apt-get install -y \ |
| 76 | + build-essential cmake tar pkg-config \ |
| 77 | + libmysqlclient-dev zlib1g-dev |
| 78 | +
|
| 79 | + - name: Configure project |
| 80 | + run: | |
| 81 | + mkdir -p build |
| 82 | + cd build |
| 83 | + cmake -DUSE_TLS=1 -DCMAKE_BUILD_TYPE=Release .. |
| 84 | +
|
| 85 | + - name: Build project |
| 86 | + run: | |
| 87 | + cd build |
| 88 | + make |
| 89 | +
|
| 90 | + - name: Generate Lua pages |
| 91 | + run: | |
| 92 | + cd build |
| 93 | + cmake --build . --target generate_lua_pages |
| 94 | +
|
| 95 | + - name: Archive bot |
| 96 | + run: | |
| 97 | + mkdir -p artifacts |
| 98 | + tar -czf artifacts/bot-arm64.tar.gz -C build/bot/bin . |
| 99 | +
|
| 100 | + - name: Archive web |
| 101 | + run: | |
| 102 | + tar -czf artifacts/web-arm64.tar.gz -C www . |
| 103 | +
|
| 104 | + - name: Upload artifacts |
| 105 | + id: upload |
| 106 | + uses: actions/upload-artifact@v4 |
| 107 | + with: |
| 108 | + name: build-artifacts-arm64 |
| 109 | + path: artifacts/ |
0 commit comments