Merge pull request #420 from fsprojects/add-workflow-repo-assist-1840 #47
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 and Test and Publish | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [windows-latest, ubuntu-22.04] | |
| dotnet: [5.0.400] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v1 | |
| - name: Setup .NET Core | |
| # Fix for https://github.com/actions/setup-dotnet/issues/29#issuecomment-548740241 | |
| uses: actions/setup-dotnet@v1 | |
| with: | |
| dotnet-version: ${{ matrix.dotnet }} | |
| - name: Setup .NET Core 6 | |
| uses: actions/setup-dotnet@v1 | |
| with: | |
| dotnet-version: 6.0.425 | |
| - name: Setup .NET Core 8 | |
| uses: actions/setup-dotnet@v1 | |
| with: | |
| dotnet-version: 8.0.400 | |
| - name: Build on Windows | |
| if: matrix.os == 'windows-latest' | |
| run: .\build.cmd | |
| - name: Build on Unix | |
| if: matrix.os != 'windows-latest' | |
| run: ./build.sh | |
| - name: Build docs (unix) | |
| if: matrix.os != 'windows-latest' | |
| run: dotnet fsdocs build --clean --properties Configuration=Release | |
| - name: Deploy documentation from master (unix) | |
| if: matrix.os != 'windows-latest' | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| personal_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./output | |
| publish_branch: gh-pages | |
| force_orphan: true | |
| - name: Publish NuGets (unix, if versions not published before) | |
| if: matrix.os != 'windows-latest' | |
| run: dotnet nuget push bin/FSharp.TypeProviders.*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_ORG_TOKEN }} --skip-duplicate | |