cc.yml (2558B)
1 --- 2 3 name: Build 4 on: 5 push: 6 tags: 7 - '*' 8 9 jobs: 10 11 build-windows: 12 name: Build 13 runs-on: ${{ matrix.os }} 14 strategy: 15 matrix: 16 include: 17 - os: windows-latest 18 cc: clang 19 bin: http-server-test.exe 20 steps: 21 - uses: actions/checkout@v3 22 23 - shell: bash 24 run: | 25 echo "/c/msys64/mingw64/bin" >> $GITHUB_PATH 26 27 - uses: finwo/dep@main 28 name: Install dep 29 30 - name: Install dependencies 31 run: dep install 32 shell: bash 33 34 - name: Build 35 shell: bash 36 run: | 37 make CC=${{ matrix.cc }} BIN=${{ matrix.bin }} 38 39 - name: Upload binaries to release 40 uses: svenstaro/upload-release-action@v2 41 with: 42 repo_token: ${{ secrets.GITHUB_TOKEN }} 43 file: ${{ matrix.bin }} 44 file_glob: true 45 overwrite: true 46 tag: ${{ github.ref }} 47 48 build-linux: 49 name: Build & test 50 runs-on: ubuntu-latest 51 strategy: 52 matrix: 53 include: 54 55 - distro: ubuntu_latest 56 arch: aarch64 57 cc: gcc 58 bin: http-server-test-aarch64 59 60 - distro: ubuntu_latest 61 arch: armv7 62 cc: gcc 63 bin: http-server-test-armv7 64 65 - distro: ubuntu_latest 66 arch: riscv64 67 cc: gcc 68 bin: http-server-test-riscv64 69 70 - distro: ubuntu_latest 71 arch: none 72 cc: gcc 73 bin: http-server-test-x86_64 74 75 steps: 76 77 - uses: actions/checkout@v3 78 79 - uses: finwo/dep@main 80 name: Install dep 81 82 - name: Install dependencies 83 run: dep install 84 shell: bash 85 86 - if: ${{ matrix.arch != 'none' }} 87 uses: uraimo/run-on-arch-action@v2 88 name: Build 89 id: runcmd 90 with: 91 arch: ${{ matrix.arch }} 92 distro: ${{ matrix.distro }} 93 githubToken: ${{ github.token }} 94 95 install: | 96 apt-get update -yq 97 apt-get install -yq build-essential 98 99 run: | 100 make CC=${{ matrix.cc }} BIN=${{ matrix.bin }} 101 102 - if: ${{ matrix.arch == 'none' }} 103 name: Build 104 shell: bash 105 run: | 106 make CC=${{ matrix.cc }} BIN=${{ matrix.bin }} 107 108 - name: Upload binaries to release 109 uses: svenstaro/upload-release-action@v2 110 with: 111 repo_token: ${{ secrets.GITHUB_TOKEN }} 112 file: ${{ matrix.bin }} 113 file_glob: true 114 overwrite: true 115 tag: ${{ github.ref }}