Skip to content

v4.0.5

v4.0.5 #80

Workflow file for this run

name: Release
on:
release:
types:
- published
permissions:
contents: write
packages: write
jobs:
release:
runs-on: ubuntu-latest
strategy:
matrix:
rid: [win-x64, linux-x64, osx-x64]
env:
# Set the build number in MinVer.
MINVERBUILDMETADATA: build.${{github.run_number}}
steps:
- name: Checkout repository
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3
- name: Restore packages
run: dotnet restore
- name: Build CLI tool
run: dotnet publish --configuration Release --output ./bin --self-contained --runtime ${{ matrix.rid }} -p:PublishSingleFile=true -p:IncludeAllContentForSelfExtract=true -p:DebugType=None -p:PublishTrimmed=false ./src/Microsoft.ComponentDetection
- name: Publish CLI tool
uses: shogo82148/actions-upload-release-asset@dbfb35b0d9069ff70bc1f9e47faba33ee30b2681 # v1.7.0
continue-on-error: true
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./bin/*
asset_name: component-detection-${{ matrix.rid }}${{ matrix.rid == 'win-x64' && '.exe' || '' }}
- name: Build NuGet packages
run: dotnet pack --configuration Release --output ./out
- name: Publish NuGet packages to GitHub Packages
run: dotnet nuget push "./out/*.nupkg" --skip-duplicate --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.pkg.github.com/${{ github.repository_owner }}
- name: Publish NuGet packages to Azure Artifacts
run: |
# https://github.com/NuGet/Home/issues/7792
dotnet nuget add source "https://pkgs.dev.azure.com/1esSharedAssets/1esPkgs/_packaging/ComponentDetection/nuget/v3/index.json" \
--name ado \
--username unused \
--password ${{ secrets.AZART_TOKEN }} \
--store-password-in-clear-text
dotnet nuget push "./out/*.nupkg" \
--skip-duplicate \
--source ado \
--api-key unused