-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (58 loc) · 1.58 KB
/
workflow.yml
File metadata and controls
65 lines (58 loc) · 1.58 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
name: CI/CD Workflow
on:
push:
branches:
- master
paths:
- 'source/**'
- 'tools/**'
- '.github/workflows/**'
- 'Directory.Build.props'
- 'Directory.Packages.props'
pull_request:
branches:
- master
paths:
- 'source/**'
- 'tools/**'
- '.github/workflows/**'
- 'Directory.Build.props'
- 'Directory.Packages.props'
release:
types: [published]
workflow_dispatch:
jobs:
ci:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write # Required for NuGet Trusted Publishing (OIDC)
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Required for version detection
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: NuGet login (OIDC Trusted Publishing)
if: github.event_name == 'release'
id: nuget-login
uses: nuget/login@v1
with:
user: TimeWarp.Enterprises
- name: Run CI Pipeline
run: |
if [ "${{ github.event_name }}" == "release" ]; then
dotnet run tools/dev-cli/dev.cs -- workflow --api-key "${{ steps.nuget-login.outputs.NUGET_API_KEY }}"
else
dotnet run tools/dev-cli/dev.cs -- workflow
fi
- name: Upload Artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: Packages-${{ github.run_number }}
path: artifacts/packages/*.nupkg
if-no-files-found: ignore