Skip to content

Commit e2ca3d6

Browse files
authored
Test release 1
Test release
2 parents 5cce838 + 4ad3925 commit e2ca3d6

6 files changed

Lines changed: 127 additions & 14 deletions

File tree

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Publish Package (Dev)
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
8+
jobs:
9+
build-and-publish:
10+
runs-on: ubuntu-latest
11+
12+
permissions:
13+
contents: read
14+
packages: write
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Setup .NET
21+
uses: actions/setup-dotnet@v4
22+
with:
23+
dotnet-version: '8.0.x'
24+
25+
- name: Authenticate GitHub Packages
26+
run: |
27+
dotnet nuget remove source githubanddone --configfile src/AndDoneSecureClientLibrary/nuget.config
28+
dotnet nuget add source \
29+
--username ${{ github.repository_owner }} \
30+
--password ${{ secrets.CLIENT_LIBRARY_NUGET_AUTH_TOKEN }} \
31+
--store-password-in-clear-text \
32+
--name githubanddone \
33+
--configfile src/AndDoneSecureClientLibrary/nuget.config \
34+
"https://nuget.pkg.github.com/AndDone-LLC/index.json"
35+
36+
- name: Restore dependencies
37+
run: dotnet restore
38+
39+
- name: Build
40+
run: dotnet build --configuration Release --no-restore
41+
42+
- name: Run tests
43+
run: dotnet test --configuration Release --no-restore --no-build
44+
45+
- name: Pack
46+
run: dotnet pack --configuration Release --no-build --output ./nupkg /p:VersionSuffix=dev.${{ github.run_number }}
47+
48+
- name: Push to GitHub Packages (Private)
49+
run: |
50+
dotnet nuget push ./nupkg/*.nupkg \
51+
--api-key ${{ secrets.CLIENT_LIBRARY_NUGET_AUTH_TOKEN }} \
52+
--source "https://nuget.pkg.github.com/AndDone-LLC/index.json" \
53+
--skip-duplicate

.github/workflows/publish-main.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Publish Package (Production)
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
mirror-and-publish:
10+
runs-on: ubuntu-latest
11+
12+
permissions:
13+
contents: read
14+
packages: write
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
# ── Mirror to Public Repo ──────────────────────────────────
23+
- name: Push to public repo
24+
run: |
25+
git remote add public https://x-access-token:${{ secrets.CLIENT_LIBRARY_NUGET_AUTH_TOKEN }}@github.com/${{ vars.PUBLIC_REPO }}.git
26+
git push public main --force
27+
28+
# ── Build & Publish to Public Account ──────────────────────
29+
- name: Setup .NET
30+
uses: actions/setup-dotnet@v4
31+
with:
32+
dotnet-version: '8.0.x'
33+
34+
- name: Authenticate GitHub Packages
35+
run: |
36+
dotnet nuget remove source githubanddone --configfile src/AndDoneSecureClientLibrary/nuget.config
37+
dotnet nuget add source \
38+
--username ${{ github.repository_owner }} \
39+
--password ${{ secrets.CLIENT_LIBRARY_NUGET_AUTH_TOKEN }} \
40+
--store-password-in-clear-text \
41+
--name githubanddone \
42+
--configfile src/AndDoneSecureClientLibrary/nuget.config \
43+
"https://nuget.pkg.github.com/AndDone-LLC/index.json"
44+
45+
- name: Restore dependencies
46+
run: dotnet restore
47+
48+
- name: Build
49+
run: dotnet build --configuration Release --no-restore
50+
51+
- name: Run tests
52+
run: dotnet test --configuration Release --no-restore --no-build
53+
54+
- name: Pack
55+
run: dotnet pack --configuration Release --no-build --output ./nupkg /p:RepositoryUrl=https://github.com/anddone-kit/AndDone-SecureAPI-ClientLibrary-DotNet.git
56+
57+
- name: Push to GitHub Packages (Public)
58+
run: |
59+
PUBLIC_OWNER=$(echo "${{ vars.PUBLIC_REPO }}" | cut -d'/' -f1)
60+
61+
dotnet nuget push ./nupkg/*.nupkg \
62+
--api-key ${{ secrets.CLIENT_LIBRARY_NUGET_AUTH_TOKEN }} \
63+
--source "https://nuget.pkg.github.com/$PUBLIC_OWNER/index.json" \
64+
--skip-duplicate

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Please see our developer documentation & API Explorer, linked below, for detaile
1010
This .NET SDK is an auto-generated client for the AndDone Secure API, built using the [OpenAPI Generator](https://openapi-generator.tech).
1111

1212
* **API version**: 2.3
13-
* **Package version**: 1.0.0
13+
* **Package version**: 1.0.3
1414
* **Generator version**: 7.9.0
1515
* **Build package**: `org.openapitools.codegen.languages.CSharpClientCodegen`
1616
* **Developer Documentation**: [DevDocs](https://docs.anddone.com/)

src/AndDoneSecureClientLibrary.Test/AndDoneSecureClientLibrary.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<AssemblyName>AndDoneSecureClientLibrary.Test</AssemblyName>
55
<RootNamespace>AndDoneSecureClientLibrary.Test</RootNamespace>
6-
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>
6+
<TargetFramework>net8.0</TargetFramework>
77
<IsPackable>false</IsPackable>
88
</PropertyGroup>
99

src/AndDoneSecureClientLibrary/AndDoneSecureClientLibrary.csproj

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,21 @@
44
<GenerateAssemblyInfo>false</GenerateAssemblyInfo><!-- setting GenerateAssemblyInfo to false causes this bug https://github.com/dotnet/project-system/issues/3934 -->
55
<TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
66
<AssemblyName>AndDoneSecureClientLibrary</AssemblyName>
7-
<PackageId>AndDoneSecureClientLibrary</PackageId>
7+
<PackageId>AndDone.AndDoneSecureClientLibrary</PackageId>
88
<OutputType>Library</OutputType>
9-
<Authors>OpenAPI</Authors>
10-
<Company>OpenAPI</Company>
11-
<AssemblyTitle>OpenAPI Library</AssemblyTitle>
12-
<Description>A library generated from a OpenAPI doc</Description>
9+
<Authors>AndDone</Authors>
10+
<Company>AndDone LLC</Company>
11+
<AssemblyTitle>AndDone Secure Client Library</AssemblyTitle>
12+
<Description>Client library for AndDone Secure API</Description>
1313
<Copyright>No Copyright</Copyright>
1414
<RootNamespace>AndDoneSecureClientLibrary</RootNamespace>
15-
<Version>1.0.0</Version>
15+
<Version>1.0.4</Version>
1616
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\AndDoneSecureClientLibrary.xml</DocumentationFile>
1717
<RepositoryUrl>https://github.com/AndDone-LLC/AndDone-SecureAPI-ClientLibrary-DotNet-private.git</RepositoryUrl>
1818
<RepositoryType>git</RepositoryType>
1919
<PackageReleaseNotes>Minor update</PackageReleaseNotes>
2020
<ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally>
21+
<IsPackable>true</IsPackable>
2122
</PropertyGroup>
2223

2324
<ItemGroup>

src/AndDoneSecureClientLibrary/nuget.config

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,7 @@
22
<configuration>
33
<packageSources>
44
<clear />
5+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
56
<add key="githubanddone" value="https://nuget.pkg.github.com/AndDone-LLC/index.json" />
67
</packageSources>
7-
<packageSourceCredentials>
8-
<github>
9-
<add key="Username" value="{GH_USER}" />
10-
<add key="ClearTextPassword" value="{GH_PAT}" />
11-
</github>
12-
</packageSourceCredentials>
138
</configuration>

0 commit comments

Comments
 (0)