ci: run pipeline also on direct push #42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: build | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - develop | |
| tags: | |
| - '*' | |
| pull_request: | |
| branches: | |
| - master | |
| - develop | |
| jobs: | |
| linux: | |
| name: Linux | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install prerequisites | |
| run: | | |
| sudo apt-get install cmake g++-mingw-w64-i686-posix mingw-w64-i686-dev | |
| sudo dpkg --add-architecture i386 | |
| sudo apt-get update | |
| sudo apt-get install nasm:i386 | |
| - name: Start SSH agent and add private key | |
| uses: webfactory/[email protected] | |
| with: | |
| ssh-private-key: ${{ secrets.CLIENT_AUTH_DEPLOY_KEY }} | |
| - name: CMake Configure | |
| run: | | |
| cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=i686-w64-mingw32-gcc -DCMAKE_CXX_COMPILER=i686-w64-mingw32-g++ -DOFFICIAL_BUILD=ON | |
| - name: Build | |
| run: | | |
| cmake --build build --parallel | |
| ln -s build/bin/cod4x_*.dll . | |
| ln -s assets/cod4x/main/*.iwd . | |
| ln -s assets/cod4x/zone/*.ff . | |
| sha1sum cod4x_*.dll *.iwd *.ff > hashes.txt | |
| - name: Publish release | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| allowUpdates: true | |
| tag: ${{ github.ref_name }} | |
| artifacts: "build/bin/cod4x_*.dll,assets/cod4x/main/*.iwd,assets/cod4x/zone/*.ff,assets/cod4x/core,assets/cod4x/mss,hashes.txt" | |
| token: ${{ secrets.GITHUB_TOKEN }} | |