summaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/macos.yml (renamed from .github/workflows/release-ninja-binaries.yml)27
-rw-r--r--.github/workflows/windows.yml49
2 files changed, 55 insertions, 21 deletions
diff --git a/.github/workflows/release-ninja-binaries.yml b/.github/workflows/macos.yml
index 8c1e0af..2a7c100 100644
--- a/.github/workflows/release-ninja-binaries.yml
+++ b/.github/workflows/macos.yml
@@ -1,4 +1,4 @@
-name: Release Ninja Binaries
+name: macOS
on:
pull_request:
@@ -8,26 +8,13 @@ on:
jobs:
build:
- runs-on: ${{ matrix.os }}
- strategy:
- matrix:
- os: [macOS-latest, windows-latest]
- include:
- - os: macOS-latest
- zip_name: ninja-mac
- - os: windows-latest
- zip_name: ninja-win
+ runs-on: macOS-latest
steps:
- uses: actions/checkout@v1
- # Install OS specific dependencies
- - name: Install macOS dependencies
- if: matrix.os == 'macOS-latest'
+ - name: Install dependencies
run: brew install re2c p7zip cmake
- - name: Install Windows dependencies
- if: matrix.os == 'windows-latest'
- run: choco install re2c
- name: Build ninja
shell: bash
@@ -39,11 +26,9 @@ jobs:
- name: Create ninja archive
shell: bash
- env:
- ZIP_NAME: ${{ matrix.zip_name }}
run: |
mkdir artifact
- 7z a artifact/${ZIP_NAME}.zip $(find ./build -name ninja -or -name ninja.exe)
+ 7z a artifact/ninja-mac.zip ./build/ninja
# Upload ninja binary archive as an artifact
- name: Upload artifact
@@ -59,6 +44,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
- asset_path: ./artifact/${{ matrix.zip_name }}.zip
- asset_name: ${{ matrix.zip_name }}.zip
+ asset_path: ./artifact/ninja-mac.zip
+ asset_name: ninja-mac.zip
asset_content_type: application/zip
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