-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (91 loc) · 3.15 KB
/
Copy pathreleaseBuild.yml
File metadata and controls
101 lines (91 loc) · 3.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Build for release
on:
workflow_run:
workflows: [.NET CI]
types: [completed]
push:
tags:
- v*
jobs:
build_and_pack:
name: Release build & package
runs-on: ubuntu-24.04
timeout-minutes: 30
if: ${{ github.event_name == 'push' || github.event.workflow_run.conclusion == 'success' }}
env:
GithubNugetUsername: craigfowler
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
lfs: true
- name: Setup build dependencies
uses: ./.github/actions/setup-build-dependencies
- name: Restore third party libs
uses: ./.github/actions/restore-dependencies
- name: Build CI version
if: ${{ github.event_name == 'workflow_run' }}
run: dotnet pack -p:VersionSuffix=ci.${{ github.run_number }} -o packages
- name: Get semantic tag version
if: ${{ github.event_name == 'push' }}
id: get_version
run: |
tagname="${{ github.ref_name }}"
echo "name=${tagname:1}" >> "$GITHUB_OUTPUT"
shell: bash
- name: Build tagged version
if: ${{ github.event_name == 'push' }}
run: dotnet pack -p:Version=${{ steps.get_version.outputs.name }} -o packages
- name: Upload build result artifacts
uses: actions/upload-artifact@v7
with:
name: Build results (NuGet)
path: packages/*.nupkg
- name: Publish packages to GitHub feed
if: ${{ github.event_name != 'pull_request' && github.ref_name == 'master' }}
run: |
dotnet nuget add source --username ${{ env.GithubNugetUsername }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/csf-dev/index.json"
for package in packages/*.nupkg
do
dotnet nuget push $package --source github
done
build_docs_site:
name: Build the documentation website
runs-on: ubuntu-24.04
timeout-minutes: 30
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
lfs: true
- name: Setup build dependencies
uses: ./.github/actions/setup-build-dependencies
- name: Restore third party libs
uses: ./.github/actions/restore-dependencies
- name: Remove old docs
run: dotnet clean CSF.Screenplay.Docs
- name: Build docs website
run: dotnet build -c Docs CSF.Screenplay.Docs
- name: Upload docs website artifact
uses: actions/upload-artifact@v7
with:
name: Docs website
path: docs/**/*
publish_nuget:
name: Publish packages to NuGet
runs-on: ubuntu-slim
if: ${{ github.event_name == 'push' }}
needs: build_and_pack
permissions:
actions: read
steps:
- name: Get release artifacts
uses: actions/download-artifact@v8
with:
name: Build results (NuGet)
path: ./packages
# - name: Publish to NuGet
# run: dotnet nuget push ./packages/*.nupkg --source https://api.nuget.org/v3/index.json