Skip to content

Commit d51a864

Browse files
committed
1.4.5
1 parent da22828 commit d51a864

5 files changed

Lines changed: 69 additions & 10 deletions

File tree

.github/workflows/release.yml

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ name: .NET CI/CD
55

66
on:
77
push:
8-
branches: [ "main" ]
8+
branches: [ "main", "pre-release/upstream" ]
99

1010
jobs:
1111
build-and-release:
1212
runs-on: windows-latest
1313
permissions:
14-
contents: write
15-
packages: write
14+
contents: write
15+
packages: read
1616
steps:
1717
- name: Checkout
1818
uses: actions/checkout@v4
@@ -33,8 +33,39 @@ jobs:
3333
id: gitversion
3434
uses: gittools/actions/gitversion/execute@v1
3535

36+
- name: Select GitHub Packages token
37+
id: package_token
38+
shell: pwsh
39+
env:
40+
OTAPI_PACKAGES_READ_TOKEN: ${{ secrets.OTAPI_PACKAGES_READ_TOKEN }}
41+
GITHUB_TOKEN_FALLBACK: ${{ secrets.GITHUB_TOKEN }}
42+
run: |
43+
if ([string]::IsNullOrWhiteSpace($env:OTAPI_PACKAGES_READ_TOKEN)) {
44+
"token=$env:GITHUB_TOKEN_FALLBACK" >> $env:GITHUB_OUTPUT
45+
"token_source=GITHUB_TOKEN" >> $env:GITHUB_OUTPUT
46+
} else {
47+
"token=$env:OTAPI_PACKAGES_READ_TOKEN" >> $env:GITHUB_OUTPUT
48+
"token_source=OTAPI_PACKAGES_READ_TOKEN" >> $env:GITHUB_OUTPUT
49+
}
50+
51+
- name: Authenticate GitHub Packages source
52+
shell: pwsh
53+
run: |
54+
dotnet nuget update source github-cedarycat `
55+
--source "https://nuget.pkg.github.com/CedaryCat/index.json" `
56+
--username "${{ github.actor }}" `
57+
--password "${{ steps.package_token.outputs.token }}" `
58+
--store-password-in-clear-text `
59+
--configfile NuGet.config
60+
3661
- name: Restore dependencies
37-
run: dotnet restore src/OTAPI.UnifiedServerProcess/OTAPI.UnifiedServerProcess.csproj
62+
shell: pwsh
63+
run: |
64+
dotnet restore src/OTAPI.UnifiedServerProcess/OTAPI.UnifiedServerProcess.csproj --configfile NuGet.config
65+
if ($LASTEXITCODE -ne 0) {
66+
Write-Host "::error::Restore failed. Check CedaryCat/otapi-packaging package visibility, package Actions access, and token scopes (read:packages)."
67+
exit $LASTEXITCODE
68+
}
3869
3970
- name: Build project with version
4071
run: >
@@ -67,7 +98,7 @@ jobs:
6798
tag_name: v${{ steps.gitversion.outputs.nuGetVersionV2 }}
6899
release_name: Release v${{ steps.gitversion.outputs.nuGetVersionV2 }}
69100
draft: false
70-
prerelease: false
101+
prerelease: ${{ github.ref == 'refs/heads/pre-release/upstream' }}
71102

72103
- name: Upload Release Asset
73104
uses: actions/upload-release-asset@v1
@@ -77,4 +108,4 @@ jobs:
77108
upload_url: ${{ steps.create_release.outputs.upload_url }}
78109
asset_path: ./UnifiedServerProcess-v${{ steps.gitversion.outputs.nuGetVersionV2 }}.zip
79110
asset_name: UnifiedServerProcess-v${{ steps.gitversion.outputs.nuGetVersionV2 }}.zip
80-
asset_content_type: application/zip
111+
asset_content_type: application/zip

NuGet.config

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<clear />
5+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
6+
<add key="github-cedarycat" value="https://nuget.pkg.github.com/CedaryCat/index.json" />
7+
</packageSources>
8+
<packageSourceMapping>
9+
<packageSource key="github-cedarycat">
10+
<package pattern="OTAPI.Upcoming" />
11+
<package pattern="ModFramework" />
12+
<package pattern="ModFramework.Modules.CSharp" />
13+
</packageSource>
14+
<packageSource key="nuget.org">
15+
<package pattern="GitVersion.*" />
16+
<package pattern="Microsoft.*" />
17+
<package pattern="Mono.*" />
18+
<package pattern="MonoMod.*" />
19+
<package pattern="NETStandard.*" />
20+
<package pattern="Newtonsoft.*" />
21+
<package pattern="NuGet.*" />
22+
<package pattern="PolySharp" />
23+
<package pattern="Steamworks.*" />
24+
<package pattern="System.*" />
25+
<package pattern="xunit*" />
26+
</packageSource>
27+
</packageSourceMapping>
28+
</configuration>

src/OTAPI.UnifiedServerProcess.GlobalNetwork/OTAPI.UnifiedServerProcess.GlobalNetwork.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<ItemGroup>
1313
<PackageReference Include="MonoMod.RuntimeDetour" Version="25.3.3" />
1414
<PackageReference Include="MonoMod.RuntimeDetour.HookGen" Version="22.7.31.1" />
15-
<PackageReference Include="ModFramework.Modules.CSharp" Version="1.1.16" />
15+
<PackageReference Include="ModFramework.Modules.CSharp" Version="1.1.15-mf-a807e26.11" />
1616
<PackageReference Include="System.IO.Packaging" Version="10.0.2" />
1717
</ItemGroup>
1818
<ItemGroup>

src/OTAPI.UnifiedServerProcess.Test/OTAPI.UnifiedServerProcess.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<ItemGroup>
1111
<PackageReference Include="MonoMod.RuntimeDetour" Version="25.2.3" />
1212
<PackageReference Include="MonoMod.RuntimeDetour.HookGen" Version="22.7.31.1" />
13-
<PackageReference Include="ModFramework.Modules.CSharp" Version="1.1.15" />
13+
<PackageReference Include="ModFramework.Modules.CSharp" Version="1.1.15-mf-a807e26.11" />
1414
</ItemGroup>
1515
<ItemGroup>
1616
<Reference Include="OTAPI">

src/OTAPI.UnifiedServerProcess/OTAPI.UnifiedServerProcess.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
</ItemGroup>
2020

2121
<ItemGroup>
22-
<PackageReference Include="OTAPI.Upcoming" Version="3.3.6" />
22+
<PackageReference Include="OTAPI.Upcoming" Version="3.3.6-mf-a807e26.11" />
2323
<PackageReference Include="MonoMod.RuntimeDetour.HookGen" Version="22.7.31.1" />
24-
<PackageReference Include="ModFramework.Modules.CSharp" Version="1.1.15" />
24+
<PackageReference Include="ModFramework.Modules.CSharp" Version="1.1.15-mf-a807e26.11" />
2525
</ItemGroup>
2626

2727
<ItemGroup>

0 commit comments

Comments
 (0)