Skip to content

Commit 13c0fce

Browse files
authored
Im/main fix nuget package (#6)
* use dotnet pack * add deploy job
1 parent ea5aca4 commit 13c0fce

2 files changed

Lines changed: 39 additions & 30 deletions

File tree

.github/workflows/build.yml

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ jobs:
4444
- name: Setup .NET
4545
uses: actions/setup-dotnet@v4
4646
with:
47-
dotnet-version: '8.0.x'
47+
dotnet-version: '6.0.x'
4848

4949
# Create the NuGet package in the folder from the environment variable NuGetDirectory
50-
- run: dotnet build --configuration Release --output ${{ env.NuGetDirectory }} .\Rws.MultiselectLanguageComboBox\Rws.MultiselectLanguageComboBox\Rws.MultiselectLanguageComboBox.csproj --p:Version=${{ env.GitVersion_Major }}.${{ env.GitVersion_Minor }}.${{ env.GitVersion_Patch }}
50+
- run: dotnet pack --configuration Release --output ${{ env.NuGetDirectory }} .\Rws.MultiselectLanguageComboBox\Rws.MultiselectLanguageComboBox\Rws.MultiselectLanguageComboBox.csproj --p:Version=${{ env.GitVersion_Major }}.${{ env.GitVersion_Minor }}.${{ env.GitVersion_Patch }}
5151

5252
# Publish the NuGet package as an artifact, so they can be used in the following jobs
5353
- uses: actions/upload-artifact@v3
@@ -57,29 +57,28 @@ jobs:
5757
retention-days: 7
5858
path: ${{ env.NuGetDirectory }}/*.nupkg
5959

60-
deploy:
61-
needs: create_nuget
62-
# Publish only when creating a GitHub Release
63-
# https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository
64-
# You can update this logic if you want to manage releases differently
65-
runs-on: windows-latest
66-
steps:
67-
# Download the NuGet package created in the previous job
68-
- uses: actions/download-artifact@v3
69-
with:
70-
name: nuget
71-
path: ${{ env.NuGetDirectory }}
72-
73-
# Install the .NET SDK indicated in the global.json file
74-
- name: Setup .NET Core
75-
uses: actions/setup-dotnet@v4
76-
77-
# Publish all NuGet packages to NuGet.org
78-
# Use --skip-duplicate to prevent errors if a package with the same version already exists.
79-
# If you retry a failed workflow, already published packages will be skipped without error.
80-
- name: Publish NuGet package
81-
run: |
82-
foreach($file in (Get-ChildItem "${{ env.NuGetDirectory }}" -Recurse -Include *.nupkg)) {
83-
dotnet nuget push $file --api-key "${{ secrets.NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate
84-
}
85-
60+
deploy:
61+
needs: create_nuget
62+
# Publish only when creating a GitHub Release
63+
# https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository
64+
# You can update this logic if you want to manage releases differently
65+
runs-on: windows-latest
66+
steps:
67+
# Download the NuGet package created in the previous job
68+
- uses: actions/download-artifact@v3
69+
with:
70+
name: nuget
71+
path: ${{ env.NuGetDirectory }}
72+
73+
# Install the .NET SDK indicated in the global.json file
74+
- name: Setup .NET Core
75+
uses: actions/setup-dotnet@v4
76+
77+
# Publish all NuGet packages to NuGet.org
78+
# Use --skip-duplicate to prevent errors if a package with the same version already exists.
79+
# If you retry a failed workflow, already published packages will be skipped without error.
80+
- name: Publish NuGet package
81+
run: |
82+
foreach($file in (Get-ChildItem "${{ env.NuGetDirectory }}" -Recurse -Include *.nupkg)) {
83+
dotnet nuget push $file --api-key "${{ secrets.NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate
84+
}

Rws.MultiselectLanguageComboBox/Rws.MultiselectLanguageComboBox/Rws.MultiselectLanguageComboBox.csproj

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,20 @@
1010
<Copyright>Copyright © Sdl Community 2023</Copyright>
1111
<PackageTags>WPF MultiselectLanguageCombo</PackageTags>
1212
<RepositoryUrl>https://github.com/sdl/Multiselect-Language-ComboBox</RepositoryUrl>
13-
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
14-
<VersionPrefix>1.0.1</VersionPrefix>
13+
<IsPackable>true</IsPackable>
14+
<version>1.0.0</version>
15+
<PackageId>Rws.MultiSelectLanguageComboBox</PackageId>
16+
<Authors>RWS</Authors>
17+
<Company>RWS</Company>
1518
</PropertyGroup>
1619

20+
<ItemGroup>
21+
<Content Include="bin/Release/**/*.*">
22+
<PackagePath>Rws.MultiselectLanguageComboBox</PackagePath>
23+
<Pack>true</Pack>
24+
</Content>
25+
</ItemGroup>
26+
1727
<ItemGroup>
1828
<PackageReference Include="Sdl.MultiSelectComboBox" Version="1.0.77" />
1929
</ItemGroup>

0 commit comments

Comments
 (0)