-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (85 loc) · 2.6 KB
/
build.yaml
File metadata and controls
96 lines (85 loc) · 2.6 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
# GitHub Actions workflow
# https://help.github.com/en/actions/reference
#
# Copyright Subatomix Research Inc.
# SPDX-License-Identifier: ISC
name: Build
run-name: Build
on:
push:
branches:
- main
- next
- release/*
tags:
- release/*
pull_request:
branches:
- main
- release/*
workflow_dispatch:
# no options
env:
# Minimize noise from dotnet CLI
DOTNET_NOLOGO: 1
jobs:
build:
name: Build
runs-on: ubuntu-latest
#url: https://github.com/actions/virtual-environments
steps:
- name: Check Out Code
uses: actions/checkout@v4
#url: https://github.com/actions/checkout
- name: Configure .NET
uses: actions/setup-dotnet@v4
#url: https://github.com/actions/setup-dotnet
with:
dotnet-version: 8.0.x
- name: Build
shell: pwsh
id: build
run: >
dotnet build src -c Release
-p:SetGitHubActionsVersion=true
-p:Branch=${{ github.ref }}
-p:Counter=${{ github.run_number }}
-p:RepositoryCommit=${{ github.sha }}
-p:PackageOutputPath=${{ runner.temp }}/dist
- name: Note Version
shell: pwsh
#url: https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions%23environment-files?tool=powershell#adding-a-job-summary
run: |
"Version: ``$env:VERSION``" >> $env:GITHUB_STEP_SUMMARY
env:
VERSION: ${{ steps.build.outputs.version }}
- name: Save Package
uses: actions/upload-artifact@v4
#url: https://github.com/actions/upload-artifact
with:
name: Packages
path: ${{ runner.temp }}/dist
if-no-files-found: error
- name: Publish Package
if: startsWith(github.ref, 'refs/tags/release/')
shell: pwsh
run: >
dotnet nuget push "${{ runner.temp }}/dist/*.nupkg"
-s https://api.nuget.org/v3/index.json
-k $env:NUGET_API_KEY
--skip-duplicate
--no-symbols
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
- name: Create Release
uses: ncipollo/release-action@v1
#url: https://github.com/ncipollo/release-action
if: startsWith(github.ref, 'refs/tags/release/')
with:
name: ${{ steps.build.outputs.version }}
prerelease: ${{ contains('-', steps.build.outputs.version) }}
draft: true
bodyFile: CHANGES.md
artifacts: ${{ runner.temp }}/dist/*nupkg
artifactErrorsFailBuild: true
token: ${{ secrets.GITHUB_TOKEN }}