|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - '*' |
| 7 | + branches: |
| 8 | + - main |
| 9 | + paths-ignore: |
| 10 | + - LICENSE |
| 11 | + - README.md |
| 12 | + pull_request: |
| 13 | + paths-ignore: |
| 14 | + - LICENSE |
| 15 | + - README.md |
| 16 | + |
| 17 | +jobs: |
| 18 | + build: |
| 19 | + name: Build |
| 20 | + runs-on: ${{ matrix.os }} |
| 21 | + container: ${{ matrix.container }} |
| 22 | + strategy: |
| 23 | + fail-fast: false |
| 24 | + matrix: |
| 25 | + os: [ubuntu-latest, windows-latest] |
| 26 | + include: |
| 27 | + - os: windows-latest |
| 28 | + - os: ubuntu-latest |
| 29 | + container: registry.gitlab.steamos.cloud/steamrt/sniper/sdk |
| 30 | + steps: |
| 31 | + - name: Checkout |
| 32 | + uses: actions/checkout@v4 |
| 33 | + with: |
| 34 | + path: MultiAddonManager |
| 35 | + submodules: recursive |
| 36 | + |
| 37 | + - name: Checkout Metamod |
| 38 | + uses: actions/checkout@v4 |
| 39 | + with: |
| 40 | + repository: alliedmodders/metamod-source |
| 41 | + ref: master |
| 42 | + path: mmsource-2.0 |
| 43 | + submodules: recursive |
| 44 | + |
| 45 | + - name: Checkout HL2SDK |
| 46 | + uses: actions/checkout@v4 |
| 47 | + with: |
| 48 | + repository: alliedmodders/hl2sdk |
| 49 | + ref: cs2 |
| 50 | + path: hl2sdk-cs2 |
| 51 | + |
| 52 | + - name: Checkout AMBuild |
| 53 | + uses: actions/checkout@v4 |
| 54 | + with: |
| 55 | + repository: alliedmodders/ambuild |
| 56 | + path: ambuild |
| 57 | + |
| 58 | + - name: Install AMBuild |
| 59 | + run: | |
| 60 | + cd ambuild && python setup.py install && cd .. |
| 61 | +
|
| 62 | + - name: Build |
| 63 | + working-directory: MultiAddonManager |
| 64 | + shell: bash |
| 65 | + run: | |
| 66 | + mkdir build && cd build |
| 67 | + python ../configure.py --enable-optimize --symbol-files --sdks cs2 |
| 68 | + ambuild |
| 69 | +
|
| 70 | + - name: Upload artifact |
| 71 | + uses: actions/upload-artifact@v4 |
| 72 | + with: |
| 73 | + name: ${{ runner.os }} |
| 74 | + path: MultiAddonManager/build/package |
| 75 | + |
| 76 | + release: |
| 77 | + name: Release |
| 78 | + if: startsWith(github.ref, 'refs/tags/') |
| 79 | + needs: build |
| 80 | + runs-on: ubuntu-latest |
| 81 | + |
| 82 | + steps: |
| 83 | + - name: Download artifacts |
| 84 | + uses: actions/download-artifact@v4 |
| 85 | + |
| 86 | + - name: Package |
| 87 | + run: | |
| 88 | + version=`echo $GITHUB_REF | sed "s/refs\/tags\///"` |
| 89 | + ls -Rall |
| 90 | + if [ -d "./Linux/" ]; then |
| 91 | + cd ./Linux/ |
| 92 | + tar -czf ../${{ github.event.repository.name }}-${version}-linux.tar.gz * |
| 93 | + cd - |
| 94 | + fi |
| 95 | + if [ -d "./Windows/" ]; then |
| 96 | + cd ./Windows/ |
| 97 | + zip -r ../${{ github.event.repository.name }}-${version}-windows.zip * |
| 98 | + cd - |
| 99 | + fi |
| 100 | +
|
| 101 | + - name: Release |
| 102 | + uses: svenstaro/upload-release-action@v2 |
| 103 | + with: |
| 104 | + repo_token: ${{ secrets.GITHUB_TOKEN }} |
| 105 | + file: ${{ github.event.repository.name }}-* |
| 106 | + tag: ${{ github.ref }} |
| 107 | + file_glob: true |
0 commit comments