Skip to content

Commit 6dc408b

Browse files
authored
Merge pull request #282 from Yubico/dennisdyallo/block-prerelease
build: Prevent prerelease dependencies from being referenced
2 parents 58d7454 + 66d581e commit 6dc408b

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

.github/workflows/build-pull-requests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ jobs:
5252
with:
5353
global-json-file: global.json
5454

55-
- name: Add local NuGet repository
55+
# Add local NuGet repository so that we can use internal pre-release versions
56+
- name: Add local NuGet repository for prerelease versions
5657
run: dotnet nuget add source --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/Yubico/index.json"
5758

5859
- name: Build Yubico.NET.SDK.sln

.github/workflows/build.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,21 +80,23 @@ jobs:
8080
- uses: actions/setup-dotnet@v4
8181
with:
8282
global-json-file: "./global.json"
83-
- name: Add local NuGet repository
83+
84+
# Add local NuGet repository so that we can use internal pre-release versions
85+
- name: Add local NuGet repository for prerelease versions
86+
if: ${{ github.event.inputs.version && (contains(github.event.inputs.version, 'prerelease') || contains(github.event.inputs.version, 'alpha') || contains(github.event.inputs.version, 'beta') || contains(github.event.inputs.version, 'rc')) }}
8487
run: dotnet nuget add source --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/Yubico/index.json"
8588

86-
- name: Modify version for internal builds
87-
if: ${{ github.event.inputs.push-to-dev == 'true' }}
89+
- name: Set build version
90+
if: ${{ github.event.inputs.version }}
8891
run: |
8992
$file = gci ./build/Versions.props
9093
$versionProp = [xml](gc $file.FullName)
91-
$versionProp.Project.PropertyGroup.YubicoCoreVersion = "${{ github.event.inputs.version }}"
92-
$versionProp.Project.PropertyGroup.YubicoYubiKeyVersion = "${{ github.event.inputs.version }}"
94+
$versionProp.Project.PropertyGroup.CommonVersion = "${{ github.event.inputs.version }}"
9395
$versionProp.Save($file.FullName)
9496
9597
# Build the project
9698
- name: Build Yubico.NET.SDK.sln
97-
run: dotnet pack --configuration Release --nologo --verbosity minimal Yubico.NET.SDK.sln
99+
run: dotnet pack --configuration Release --nologo --verbosity minimal --treatWarningsAsErrors Yubico.NET.SDK.sln
98100

99101
# Build the documentation
100102
- name: Build docs

build/sign.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,8 @@ function Process-ZipPackage {
202202
Get-ChildItem -Path $extractPath -Recurse -Filter "*.nuspec" |
203203
ForEach-Object {
204204
Write-Host " 📥 Packing: $($_.Name)"
205-
$output = & $NuGetPath pack $_.FullName -OutputDirectory $Directories.Packages 2>&1
206-
205+
$output = & $NuGetPath pack $_.FullName -OutputDirectory $Directories.Packages -p TreatWarningsAsErrors=true 2>&1
206+
207207
if ($LASTEXITCODE -ne 0) {
208208
$output | ForEach-Object { Write-Host $_ }
209209
throw "Packing failed for file: $($_.FullName)"

0 commit comments

Comments
 (0)