v5.1.17 #150
Workflow file for this run
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
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, win-arm64, linux-arm64, osx-arm64] | |
env: | |
# Set the build number in MinVer. | |
MINVERBUILDMETADATA: build.${{github.run_number}} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
fetch-depth: 0 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@3e891b0cb619bf60e2c25674b222b8940e2c1c25 # v4.1.0 | |
- 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@8482bd769644976d847e96fb4b9354228885e7b4 # v1.7.8 | |
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' || matrix.rid == 'win-arm64') && '.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 }} |