forked from fsprojects/FSharpLint
-
Notifications
You must be signed in to change notification settings - Fork 0
123 lines (110 loc) · 3.13 KB
/
build+test+deploy.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
name: CI
on:
pull_request:
push:
tags:
- 'v*'
branches:
- '**'
env:
DOTNET_VERSION: 6.0.417
jobs:
buildAndTest:
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macOS-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Restore tools
run: dotnet tool restore
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet fake build -t Build
- name: Run tests
run: dotnet fake build -t Test
- name: Run FSharpLint on itself
run: dotnet fake build -t SelfCheck
deployReleaseBinaries:
needs: buildAndTest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Restore tools
run: dotnet tool restore
- name: Build
run: dotnet fake build
- name: Pack
run: dotnet fake build -t Pack
- name: Get Changelog Entry
id: changelog_reader
uses: mindsers/[email protected]
with:
version: ${{ github.ref }}
path: ./CHANGELOG.md
- name: Upload binaries to nuget (if nugetKey present)
env:
nuget-key: ${{ secrets.NUGET_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: dotnet fake build -t Push
- name: Create Release (if tag)
if: startsWith(github.ref, 'refs/tags/')
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body: ${{ steps.changelog_reader.outputs.log_entry }}
draft: false
prerelease: false
- name: Upload binaries to release (if tag)
if: startsWith(github.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: out/*.nupkg
tag: ${{ github.ref }}
overwrite: true
file_glob: true
deployReleaseDocs:
needs: deployReleaseBinaries
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
# old .NET required by old fornax version
- name: Setup old .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 3.1.x
- name: Restore tools
run: dotnet tool restore
- name: Restore dependencies
run: dotnet restore
- name: Run Fornax
run: dotnet fake build -t Docs
- name: Deploy (if tag)
if: startsWith(github.ref, 'refs/tags/')
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_public
publish_branch: gh-pages
force_orphan: true