-
Notifications
You must be signed in to change notification settings - Fork 90
82 lines (66 loc) · 2.15 KB
/
push.yml
File metadata and controls
82 lines (66 loc) · 2.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Build and Test and Publish
on:
push:
branches:
- master
permissions:
contents: write # for peaceiris/actions-gh-pages
id-token: write # for NuGet trusted publishing
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-22.04]
dotnet: [8.0.124]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet }}
- name: Setup .NET Core 6
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.425
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('paket.lock', '.config/dotnet-tools.json') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Cache FAKE build artifacts
uses: actions/cache@v4
with:
path: .fake
key: ${{ runner.os }}-fake-${{ hashFiles('build.fsx', 'build.fsx.lock') }}
restore-keys: |
${{ runner.os }}-fake-
- 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@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./output
publish_branch: gh-pages
force_orphan: true
- name: Obtain NuGet key
# this hash is v1.1.0
uses: NuGet/login@d22cc5f58ff5b88bf9bd452535b4335137e24544
id: login
with:
user: dsyme
- 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 ${{ steps.login.outputs.NUGET_API_KEY }} --skip-duplicate