Update #102
This file contains 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: ["*"] | |
tags-ignore: ["v*"] | |
pull_request: | |
branches: ["main"] | |
jobs: | |
build-native: | |
strategy: | |
matrix: | |
os: | |
[ ubuntu-latest, macos-latest, windows-latest ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: "true" | |
fetch-depth: 0 | |
- name: Install .NET Sdk | |
uses: actions/setup-dotnet@v3 | |
with: | |
global-json-file: global.json | |
- name: Install gitversions | |
run: | | |
dotnet tool install --global GitVersion.Tool | |
- uses: nuget/setup-nuget@v1 | |
with: | |
nuget-api-key: ${{ secrets.NUGET_API_KEY }} | |
nuget-version: "latest" | |
- name: Install ninja meson | |
run: pip3 install ninja meson | |
- uses: ilammy/msvc-dev-cmd@v1 | |
if: ${{ matrix.os == 'windows-latest' }} | |
- name: Build tree-sitter | |
run: | | |
./build.ps1 -Pack | |
shell: pwsh | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: Nupkgs | |
path: "*.nupkg" | |
build-managed: | |
needs: build-native | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: "true" | |
fetch-depth: 0 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: Nupkgs | |
path: ./native/nupkgs | |
- name: Install .NET Sdk | |
uses: actions/setup-dotnet@v3 | |
with: | |
global-json-file: global.json | |
- name: Do release | |
run: | | |
dotnet tool install --global dotnet-releaser | |
dotnet-releaser build ./dotnet-releaser.toml | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Artifacts | |
path: "artifacts-dotnet-releaser" |