-
Notifications
You must be signed in to change notification settings - Fork 3
109 lines (102 loc) · 3.03 KB
/
build.yml
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Xenial.Tasty
on:
schedule:
- cron: "30 0 * * *"
push:
branches: [main]
tags: [v*]
pull_request:
branches: [main]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- name: Fetch all history for all tags and branches
run: |
git fetch --prune --unshallow
- name: Setup .NETCORE3.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x
- name: Setup .NET6
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Build
run: dotnet run --project build/Tasty.Build/Tasty.Build.csproj pack
- uses: actions/upload-artifact@v2
if: runner.os == 'Windows' && startsWith(github.ref, 'refs/tags/v')
with:
name: nuget
path: artifacts/nuget/
docs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Fetch all history for all tags and branches
run: |
git fetch --prune --unshallow
# Remove global json cause wyam needs 2.2
- name: Delete global.json
run: |
del global.json
- name: Setup .NET Core 2.2
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.2.x
# Install with a tool location to trick tool resolution
- name: Install Wyam.Tool
run: dotnet tool install --tool-path c:\dotnet-tools Wyam.Tool
# Run from the installed tool location
- name: Build
run: c:\dotnet-tools\wyam.exe docs -o ..\artifacts\docs
- uses: actions/upload-artifact@v2
if: startsWith(github.ref, 'refs/tags/v')
with:
name: docs
path: artifacts/docs/
deploy-docs:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
needs: [docs]
steps:
- uses: actions/download-artifact@v2
with:
name: docs
path: artifacts/docs/
- name: Upload ftp
uses: sebastianpopp/ftp-action@releases/v2
with:
host: ${{ secrets.FTP_HOST }}
user: ${{ secrets.FTP_USER }}
password: ${{ secrets.FTP_PASS }}
localDir: artifacts/docs/
deploy-packages:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
needs: [build]
steps:
- uses: actions/checkout@v2
- name: Fetch all history for all tags and branches
run: |
git fetch --prune --unshallow
- uses: actions/download-artifact@v2
with:
name: nuget
path: artifacts/nuget/
- name: Setup .NETCORE3.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x
- name: Setup .NET6
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Publish to nuget.org
run: dotnet run --project build/Tasty.Build/Tasty.Build.csproj deploy.nuget
env:
NUGET_AUTH_TOKEN: ${{secrets.NUGET_API_KEY}}