-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: upload precompiled binaries to releases (#37)
- Loading branch information
1 parent
5393736
commit a607edc
Showing
3 changed files
with
76 additions
and
103 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,10 +1,14 @@ | ||
name: Component Detection PR | ||
name: Build | ||
|
||
on: [pull_request] | ||
on: | ||
push: | ||
pull_request: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
env: | ||
|
@@ -13,20 +17,21 @@ jobs: | |
MINVERBUILDMETADATA: build.${{github.run_number}} | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
- name: Checkout repository | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup .NET Core | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 3.1.x | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 3.1.x | ||
|
||
- name: dotnet restore | ||
run: dotnet restore | ||
- name: Restore packages | ||
run: dotnet restore | ||
|
||
- name: Build and publish | ||
run: dotnet publish -o dist --no-self-contained -c Release ./src/Microsoft.ComponentDetection | ||
- name: Build | ||
run: dotnet build --no-restore --configuration Debug | ||
|
||
- name: Run tests | ||
run: dotnet test | ||
- name: Run tests | ||
run: dotnet test --no-build --configuration Debug |
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
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: | ||
OFFICIAL_BUILD: 'True' | ||
# Set the build number in MinVer. | ||
MINVERBUILDMETADATA: build.${{github.run_number}} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup .NET | ||
uses: actions/[email protected] | ||
with: | ||
dotnet-version: 3.1.x | ||
|
||
- 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:DebugType=None -p:PublishTrimmed=true ./src/Microsoft.ComponentDetection | ||
|
||
- name: Publish CLI tool | ||
uses: shogo82148/[email protected] | ||
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: dotnet nuget push ./out/*.nupkg --skip-duplicate --api-key ${{ secrets.AZART_TOKEN }} --source https://1essharedassets.pkgs.visualstudio.com/1esPkgs/_packaging/ComponentDetection/nuget/v3/index.json |