-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
50 additions
and
33 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 |
---|---|---|
|
@@ -4,19 +4,30 @@ | |
name: build | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
configuration: | ||
type: choice | ||
description: Configuration | ||
options: | ||
- Release | ||
- Debug | ||
push: | ||
branches: [ main, dev, 'feature/*', 'rel/*' ] | ||
branches: [ main, dev, 'dev/*', 'feature/*', 'rel/*' ] | ||
paths-ignore: | ||
- docs/**/* | ||
- changelog.md | ||
- readme.md | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
|
||
env: | ||
DOTNET_NOLOGO: true | ||
Configuration: Release | ||
PackOnBuild: true | ||
GeneratePackageOnBuild: true | ||
VersionPrefix: 42.42.${{ github.run_number }} | ||
VersionLabel: ${{ github.ref }} | ||
GH_TOKEN: ${{ secrets.GH_TOKEN }} | ||
MSBUILDTERMINALLOGGER: auto | ||
Configuration: ${{ github.event.inputs.configuration || 'Release' }} | ||
|
||
defaults: | ||
run: | ||
|
@@ -27,10 +38,7 @@ jobs: | |
runs-on: windows-latest | ||
steps: | ||
- name: 🤘 checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
fetch-depth: 0 | ||
uses: actions/checkout@v4 | ||
|
||
- name: ⚙ msbuild | ||
uses: microsoft/[email protected] | ||
|
@@ -42,27 +50,28 @@ jobs: | |
dotnet restore Scenarios/given_a_packaging_project/a.nuproj | ||
msbuild -r | ||
- name: 📦 binlog | ||
- name: 🐛 logs | ||
uses: actions/upload-artifact@v3 | ||
if: always() | ||
if: runner.debug && always() | ||
with: | ||
name: binlog-build-${{ github.run_number }} | ||
path: src/NuGetizer.Tests/msbuild.binlog | ||
|
||
- name: 🧪 test | ||
uses: ./.github/workflows/test | ||
run: | | ||
dotnet tool update -g dotnet-retest | ||
dotnet retest -- --no-build | ||
- name: 📦 pack | ||
run: dotnet pack -m:1 | ||
|
||
- name: 📦 binlog | ||
- name: 🐛 logs | ||
uses: actions/upload-artifact@v3 | ||
if: always() | ||
if: runner.debug && always() | ||
with: | ||
name: binlog-pack-${{ github.run_number }} | ||
path: msbuild.binlog | ||
|
||
# Only push CI package to sleet feed if building on ubuntu (fastest) | ||
- name: 🚀 sleet | ||
env: | ||
SLEET_CONNECTION: ${{ secrets.SLEET_CONNECTION }} | ||
|
@@ -75,10 +84,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- name: 🤘 checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
fetch-depth: 0 | ||
uses: actions/checkout@v4 | ||
|
||
- name: ✓ ensure format | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,25 +5,23 @@ | |
name: publish | ||
on: | ||
release: | ||
types: [released] | ||
types: [prereleased, released] | ||
|
||
env: | ||
DOTNET_NOLOGO: true | ||
Configuration: Release | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
PackOnBuild: true | ||
GeneratePackageOnBuild: true | ||
VersionLabel: ${{ github.ref }} | ||
GH_TOKEN: ${{ secrets.GH_TOKEN }} | ||
MSBUILDTERMINALLOGGER: auto | ||
|
||
jobs: | ||
publish: | ||
runs-on: windows-latest | ||
steps: | ||
- name: 🤘 checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
fetch-depth: 0 | ||
uses: actions/checkout@v4 | ||
|
||
- name: ⚙ msbuild | ||
uses: microsoft/[email protected] | ||
|
@@ -35,25 +33,38 @@ jobs: | |
dotnet restore Scenarios/given_a_packaging_project/a.nuproj | ||
msbuild -r | ||
- name: 📦 binlog | ||
- name: 🐛 logs | ||
uses: actions/upload-artifact@v3 | ||
if: always() | ||
if: runner.debug && always() | ||
with: | ||
name: binlog-build-${{ github.run_number }} | ||
path: src/NuGetizer.Tests/msbuild.binlog | ||
|
||
- name: 🧪 test | ||
uses: ./.github/workflows/test | ||
run: | | ||
dotnet tool update -g dotnet-retest | ||
dotnet retest -- --no-build | ||
- name: 📦 pack | ||
run: dotnet pack -p:version=${GITHUB_REF#refs/*/v} | ||
run: dotnet pack | ||
|
||
- name: 📦 binlog | ||
- name: 🐛 logs | ||
uses: actions/upload-artifact@v3 | ||
if: always() | ||
if: runner.debug && always() | ||
with: | ||
name: binlog-pack-${{ github.run_number }} | ||
path: msbuild.binlog | ||
|
||
- name: 🚀 nuget | ||
run: dotnet nuget push ./bin/*.nupkg -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}} --skip-duplicate | ||
env: | ||
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | ||
if: env.NUGET_API_KEY != '' | ||
run: dotnet nuget push ./bin/**/*.nupkg -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}} --skip-duplicate | ||
|
||
- name: 🚀 sleet | ||
env: | ||
SLEET_CONNECTION: ${{ secrets.SLEET_CONNECTION }} | ||
if: env.SLEET_CONNECTION != '' | ||
run: | | ||
dotnet tool install -g --version 4.0.18 sleet | ||
sleet push bin --config none -f --verbose -p "SLEET_FEED_CONTAINER=nuget" -p "SLEET_FEED_CONNECTIONSTRING=${{ secrets.SLEET_CONNECTION }}" -p "SLEET_FEED_TYPE=azure" || echo "No packages found" |