-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(workflows): Added NuGet publishing step
- Loading branch information
Showing
3 changed files
with
34 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Build (and Release) | ||
name: Build, Release, Publish | ||
|
||
on: | ||
push: | ||
|
@@ -99,24 +99,25 @@ jobs: | |
needs: [ unit-test, integration-test ] | ||
if: github.ref == 'refs/heads/main' && github.event_name == 'push' | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && secrets.ELEVATED_GITHUB_TOKEN || github.token }} | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v3 | ||
|
||
- name: Build | ||
run: dotnet build --configuration Release | ||
- name: Install Versionize | ||
run: dotnet tool install --global Versionize | ||
|
||
- name: Setup git | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "Versionize Bot" | ||
- name: Versionize Release | ||
- name: Install Versionize | ||
run: dotnet tool install --global Versionize | ||
|
||
- name: Run Versionize | ||
id: versionize | ||
run: 'versionize --changelog-all --exit-insignificant-commits --commit-suffix " [skip ci]"' | ||
continue-on-error: true | ||
|
@@ -132,6 +133,10 @@ jobs: | |
github_token: ${{ secrets.ELEVATED_GITHUB_TOKEN }} | ||
branch: ${{ github.ref }} | ||
tags: true | ||
|
||
- name: Create NuPkg | ||
if: steps.versionize.outcome == 'success' | ||
run: dotnet pack --configuration Release | ||
|
||
- name: Download ubuntu artifacts | ||
if: steps.versionize.outcome == 'success' | ||
|
@@ -160,6 +165,7 @@ jobs: | |
zip -r ScorecardGenerator-ubuntu-x64-$version.zip ubuntu-artifacts | ||
zip -r ScorecardGenerator-windows-x64-$version.zip windows-artifacts | ||
zip -r ScorecardGenerator-macos-x64-$version.zip macos-artifacts | ||
zip -r ScorecardGenerator-nupkg-x64-$version.zip ScorecardGenerator/nupkg/*.nupkg -j | ||
if: steps.versionize.outcome == 'success' | ||
- name: "Create release with all artifacts" | ||
|
@@ -173,9 +179,20 @@ jobs: | |
--target ${{ github.sha }} \ | ||
--title "$version" \ | ||
-F CHANGELOG.md \ | ||
ScorecardGenerator-nupkg-x64-$version.zip \ | ||
ScorecardGenerator-ubuntu-x64-$version.zip \ | ||
ScorecardGenerator-windows-x64-$version.zip \ | ||
ScorecardGenerator-macos-x64-$version.zip | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.ELEVATED_GITHUB_TOKEN }} | ||
shell: bash | ||
|
||
- name: Publish to NuGet | ||
if: steps.versionize.outcome == 'success' | ||
run: | | ||
version=$(git describe --tags --abbrev=0) | ||
dotnet nuget push ScorecardGenerator/nupkg/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.ELEVATED_GITHUB_TOKEN }} | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,7 @@ riderModule.iml | |
.DS_Store | ||
|
||
# vale | ||
styles | ||
styles | ||
|
||
# nuget packages | ||
nupkg/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
<Version>1.1.0</Version> | ||
<PackAsTool>true</PackAsTool> | ||
<PackageOutputPath>./nupkg</PackageOutputPath> | ||
<PackageLicenseFile>LICENSE</PackageLicenseFile> | ||
<PackageLicenseExpression>GPL-3.0-only</PackageLicenseExpression> | ||
<PackageReadmeFile>README.md</PackageReadmeFile> | ||
<Description>Generate Azure Wiki-friendly markdown files with scores for dotnet projects.</Description> | ||
<PackageProjectUrl>https://github.com/ViMaSter/service-scorecard-generator</PackageProjectUrl> | ||
|
@@ -37,28 +37,11 @@ | |
<EmbeddedResource Include="Checks\PendingRenovateAzurePRs\README.md" /> | ||
<EmbeddedResource Include="Checks\ProperDockerfile\README.md" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Include="..\LICENSE" Pack="true" PackagePath=""/> | ||
<None Include="..\README.md" Pack="true" PackagePath=""/> | ||
<Version>1.0.0</Version> | ||
<PackAsTool>true</PackAsTool> | ||
<PackageOutputPath>./nupkg</PackageOutputPath> | ||
<PackageLicenseFile>LICENSE</PackageLicenseFile> | ||
<PackageReadmeFile>README.md</PackageReadmeFile> | ||
<Description>Generate Azure Wiki-friendly markdown files with scores for dotnet projects.</Description> | ||
<PackageProjectUrl>https://github.com/ViMaSter/service-scorecard-generator</PackageProjectUrl> | ||
<RepositoryType>git</RepositoryType> | ||
<RepositoryUrl>https://github.com/ViMaSter/service-scorecard-generator.git</RepositoryUrl> | ||
<Authors>Vincent Mahnke ([email protected])</Authors> | ||
<Copyright>(c) 2023 by Vincent Mahnke</Copyright> | ||
<PackageTags>dotnet;csharp;azure-devops;markdown</PackageTags> | ||
<PackageReleaseNotes>Check CHANGELOG.md</PackageReleaseNotes> | ||
<None Include="..\README.md" Pack="true" PackagePath="README.md"> | ||
<Link>README.md</Link> | ||
</None> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Include="..\LICENSE" Pack="true" PackagePath=""/> | ||
<None Include="..\README.md" Pack="true" PackagePath=""/> | ||
</ItemGroup> | ||
|
||
</Project> |