Skip to content

Commit ab3c7d5

Browse files
committed
Update ci to publish internal package
1 parent 6d2010b commit ab3c7d5

7 files changed

Lines changed: 66 additions & 25 deletions

File tree

.github/workflows/build-and-test.yml

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,13 @@ on:
44
push:
55
branches:
66
- main
7-
- release/*
8-
tags:
9-
- "v*"
10-
pull_request:
11-
branches:
12-
- main
13-
- release/*
14-
types: [ opened, synchronize, reopened ]
157

168
jobs:
179
# Prime a single LFS cache and expose the exact key for the matrix
1810
WarmLFS:
1911
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
2014
outputs:
2115
lfs_key: ${{ steps.expose-key.outputs.lfs_key }}
2216
steps:
@@ -60,6 +54,8 @@ jobs:
6054

6155
Build:
6256
needs: WarmLFS
57+
permissions:
58+
contents: read
6359
strategy:
6460
matrix:
6561
options:
@@ -223,6 +219,9 @@ jobs:
223219
token: ${{ secrets.CODECOV_TOKEN }}
224220

225221
Publish:
222+
permissions:
223+
id-token: write # Required for OIDC
224+
contents: read
226225
needs: [Build]
227226
runs-on: ubuntu-latest
228227
if: (github.event_name == 'push')
@@ -242,6 +241,16 @@ jobs:
242241
- name: NuGet Install
243242
uses: NuGet/setup-nuget@v2
244243

244+
- name: Compute Version
245+
id: compute-version
246+
shell: pwsh
247+
run: |
248+
$date = Get-Date -Format "yyyy.MM.dd"
249+
$buildNumber = "${{ github.run_number }}"
250+
$version = "$date-mc.$buildNumber"
251+
echo "version=$version" >> $env:GITHUB_OUTPUT
252+
echo "Computed version: $version"
253+
245254
- name: NuGet Setup Cache
246255
uses: actions/cache@v4
247256
id: nuget-cache
@@ -252,17 +261,19 @@ jobs:
252261

253262
- name: DotNet Pack
254263
shell: pwsh
255-
run: ./ci-pack.ps1
264+
run: ./ci-pack.ps1 -version "${{ steps.compute-version.outputs.version }}"
256265

257-
- name: Feedz Publish
258-
shell: pwsh
259-
run: |
260-
dotnet nuget push .\artifacts\*.nupkg -k ${{secrets.FEEDZ_TOKEN}} -s https://f.feedz.io/sixlabors/sixlabors/nuget/index.json --skip-duplicate
261-
dotnet nuget push .\artifacts\*.snupkg -k ${{secrets.FEEDZ_TOKEN}} -s https://f.feedz.io/sixlabors/sixlabors/symbols --skip-duplicate
266+
- name: Azure Login
267+
uses: azure/login@v2
268+
with:
269+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
270+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
271+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
272+
273+
- name: Install Sleet
274+
run: dotnet tool install -g sleet
262275

263-
- name: NuGet Publish
264-
if: ${{ startsWith(github.ref, 'refs/tags/') }}
276+
- name: Publish Internal
265277
shell: pwsh
266278
run: |
267-
dotnet nuget push .\artifacts\*.nupkg -k ${{secrets.NUGET_TOKEN}} -s https://api.nuget.org/v3/index.json --skip-duplicate
268-
dotnet nuget push .\artifacts\*.snupkg -k ${{secrets.NUGET_TOKEN}} -s https://api.nuget.org/v3/index.json --skip-duplicate
279+
sleet push ./artifacts --config sleet.json artifacts

Directory.Build.props

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@
1515
<SixLaborsSolutionDirectory>$(MSBuildThisFileDirectory)</SixLaborsSolutionDirectory>
1616
</PropertyGroup>
1717

18+
<PropertyGroup>
19+
<RestoreSources>
20+
$(RestoreSources);
21+
https://mcpublicnugetstouse.blob.core.windows.net/imagesharp/index.json
22+
</RestoreSources>
23+
</PropertyGroup>
24+
1825
<!-- Import the shared global .props file -->
1926
<Import Project="$(MSBuildThisFileDirectory)shared-infrastructure\msbuild\props\SixLabors.Global.props" />
2027

ci-pack.ps1

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
param(
2+
[Parameter(Mandatory = $true, Position = 0)]
3+
[string]$Version
4+
)
5+
16
dotnet clean -c Release
27

38
$repositoryUrl = "https://github.com/$env:GITHUB_REPOSITORY"
49

510
# Building for packing and publishing.
6-
dotnet pack -c Release --output "$PSScriptRoot/artifacts" /p:RepositoryUrl=$repositoryUrl
11+
dotnet pack -c Release --output "$PSScriptRoot/artifacts" /p:RepositoryUrl=$repositoryUrl -p:MinVerVersionOverride=$Version
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<packageSources>
4-
<add key="myget.org sixlabors-CI" value="https://www.myget.org/F/sixlabors/api/v3/index.json" />
4+
<add key="mediaclip-imagesharp" value="https://mcpublicnugetstouse.blob.core.windows.net/imagesharp/index.json" />
55
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
66
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
77
</packageSources>
8-
</configuration>
8+
</configuration>

sleet.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"username": "",
3+
"useremail": "",
4+
"sources": [
5+
{
6+
"name": "ImageSharp",
7+
"type": "azure",
8+
"container": "imagesharp",
9+
"path": "https://mcpublicnugetstouse.blob.core.windows.net/imagesharp/"
10+
}
11+
]
12+
}

src/ImageSharp.Drawing/ImageSharp.Drawing.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<Nullable>enable</Nullable>
2626
<WarningsAsErrors>Nullable</WarningsAsErrors>
2727
</PropertyGroup>
28-
28+
2929
<Choose>
3030
<When Condition="$(SIXLABORS_TESTING_PREVIEW) == true">
3131
<PropertyGroup>
@@ -38,15 +38,15 @@
3838
</PropertyGroup>
3939
</Otherwise>
4040
</Choose>
41-
41+
4242
<ItemGroup>
4343
<None Include="..\..\LICENSE" Pack="true" PackagePath="" />
4444
<None Include="..\..\shared-infrastructure\branding\icons\imagesharp.drawing\sixlabors.imagesharp.drawing.128.png" Pack="true" PackagePath="" />
4545
</ItemGroup>
4646
<ItemGroup>
47-
<PackageReference Include="SixLabors.Fonts" Version="3.0.0-alpha.0.16" />
48-
<PackageReference Include="SixLabors.ImageSharp" Version="4.0.0-alpha.0.70" />
4947
<PackageReference Include="SixLabors.PolygonClipper" Version="1.0.0-alpha.0.49" />
48+
<PackageReference Include="SixLabors.Fonts" Version="2025.12.15-mc.1" />
49+
<PackageReference Include="SixLabors.ImageSharp" Version="2025.12.15-mc.1" />
5050
</ItemGroup>
5151
<Import Project="..\..\shared-infrastructure\src\SharedInfrastructure\SharedInfrastructure.projitems" Label="Shared" />
5252
</Project>

tests/Directory.Build.props

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,10 @@
2020
<UseImageSharp>true</UseImageSharp>
2121
</PropertyGroup>
2222

23+
<PropertyGroup>
24+
<RestoreSources>
25+
$(RestoreSources);
26+
https://mcpublicnugetstouse.blob.core.windows.net/imagesharp/index.json
27+
</RestoreSources>
28+
</PropertyGroup>
2329
</Project>

0 commit comments

Comments
 (0)