diff options
Diffstat (limited to '.github/workflows/windows.yml')
-rw-r--r-- | .github/workflows/windows.yml | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 0000000..bdec6c9 --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,49 @@ +name: Windows + +on: + pull_request: + push: + release: + types: published + +jobs: + build: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v1 + + - name: Install dependencies + run: choco install re2c + + - name: Build ninja + shell: bash + run: | + mkdir build && cd build + cmake -DCMAKE_BUILD_TYPE=Release .. + cmake --build . --parallel --config Release + ctest -vv + + - name: Create ninja archive + shell: bash + run: | + mkdir artifact + 7z a artifact/ninja-win.zip ./build/Release/ninja.exe + + # Upload ninja binary archive as an artifact + - name: Upload artifact + uses: actions/upload-artifact@v1 + with: + name: ninja-binary-archives + path: artifact + + - name: Upload release asset + if: github.event.action == 'published' + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./artifact/ninja-win.zip + asset_name: ninja-win.zip + asset_content_type: application/zip |