-
-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathcodeberg.yaml
More file actions
146 lines (121 loc) · 5.06 KB
/
Copy pathcodeberg.yaml
File metadata and controls
146 lines (121 loc) · 5.06 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: MsccGenerativeAI
on:
push:
tags:
- 'v*'
paths:
- '**'
- '.forgejo/workflows/codeberg.yaml'
- '!**.md'
- '!docs/**'
- '!samples/**'
- '!tests/**'
- '!LICENSE'
pull_request:
branches:
- main
paths:
- '**'
- '.forgejo/workflows/codeberg.yaml'
- '!**.md'
- '!docs/**'
- '!samples/**'
- '!tests/**'
- '!LICENSE'
workflow_dispatch:
inputs:
version:
description: 'Version number (e.g., 3.0.0)'
required: true
default: '3.0.0'
type: string
jobs:
build_and_push_main:
name: Build and Push Main Package to Codeberg
strategy:
matrix:
os: [codeberg-small]
# os: [ubuntu-latest, windows-latest, macos-latest]
dotnet-version: ['10.x']
runs-on: ${{ matrix.os }}
steps:
# - name: enable windows longpaths
# run: |
# git config --global core.longpaths true
# - name: Install Cosign
# uses: sigstore/cosign-installer@v3.6.0
# - name: Check Cosign install!
# run: cosign version
- name: 📥 Check-out latest sources
uses: actions/checkout@v6
- name: 🔧 Set up .NET
uses: https://github.com/actions/setup-dotnet@v5
with:
dotnet-version: ${{ matrix.dotnet-version }}
# source-url: https://nuget.pkg.github.com/mscraftsman/index.json
env:
# NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
# NetFX testing on non-Windows requires mono
# - name: 🔧 Setup Mono
# if: runner.os == 'Linux'
# run: sudo apt-get install -y mono-devel
- name: 🏗️ Build for .NET
run: dotnet build ./src/Mscc.GenerativeAI/Mscc.GenerativeAI.csproj -c Release
- name: 📦 Pack for .NET
run: dotnet pack -c Release ./src/Mscc.GenerativeAI/Mscc.GenerativeAI.csproj -o output/ --no-build
- name: Set NuGet source
run: mv ./nuget.codeberg ./nuget.config
# - name: Setup access to Codeberg Package Registry
# run: dotnet nuget add source --username ${{ vars.USERNAME }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name ghmain "https://nuget.pkg.github.com/mscraftsman/index.json"
- name: Push to Codeberg Package Registry
run: dotnet nuget push output/Mscc.GenerativeAI.*.nupkg --skip-duplicate -s codeberg -k ${{ secrets._NUGET_API_KEY }}
build_and_push_dependents:
name: Build and Push Dependent Packages to Codeberg
needs: build_and_push_main
strategy:
matrix:
os: [codeberg-small]
# os: [ubuntu-latest, windows-latest, macos-latest]
dotnet-version: ['10.x']
runs-on: ${{ matrix.os }}
steps:
# - name: Wait for Codeberg package propagation
# run: sleep 300
- name: 📥 Check-out latest sources
uses: actions/checkout@v6
- name: 🔧 Set up .NET
uses: https://github.com/actions/setup-dotnet@v5
with:
dotnet-version: ${{ matrix.dotnet-version }}
# source-url: https://nuget.pkg.github.com/mscraftsman/index.json
env:
# NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
# NetFX testing on non-Windows requires mono
# - name: 🔧 Setup Mono
# if: runner.os == 'Linux'
# run: sudo apt-get install -y mono-devel
# - name: 🔧 Setup access to Codeberg Package Registry
# run: dotnet nuget add source --username ${{ vars.USERNAME }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/mscraftsman/index.json"
- name: Set NuGet source
run: mv ./nuget.codeberg ./nuget.config
- name: Restore Dependencies
run: dotnet restore ./GenerativeAI.sln
- name: 🏗️ Build
run: dotnet build ./GenerativeAI.sln -c Release
- name: 📦 Pack for ASP.NET Core
run: dotnet pack -c Release ./src/Mscc.GenerativeAI.Web/Mscc.GenerativeAI.Web.csproj -o output/ --no-build
- name: 📦 Pack for .NET using Google Cloud Client Library
run: dotnet pack -c Release ./src/Mscc.GenerativeAI.Google/Mscc.GenerativeAI.Google.csproj -o output/ --no-build
- name: 📦 Pack for Microsoft.Extension.AI and Microsoft Semantic Kernel
run: dotnet pack -c Release ./src/Mscc.GenerativeAI.Microsoft/Mscc.GenerativeAI.Microsoft.csproj -o output/ --no-build
- name: Push to Codeberg Package Registry
run: |
dotnet nuget push output/Mscc.GenerativeAI.Web.*.nupkg --skip-duplicate -s codeberg -k ${{ secrets._NUGET_API_KEY }}
dotnet nuget push output/Mscc.GenerativeAI.Google.*.nupkg --skip-duplicate -s codeberg -k ${{ secrets._NUGET_API_KEY }}
dotnet nuget push output/Mscc.GenerativeAI.Microsoft.*.nupkg --skip-duplicate -s codeberg -k ${{ secrets._NUGET_API_KEY }}