-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
870842f
commit 7f61844
Showing
2 changed files
with
61 additions
and
63 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 |
---|---|---|
@@ -1,59 +1,59 @@ | ||
name: ci | ||
|
||
on: | ||
push: | ||
pull_request: | ||
workflow_dispatch: | ||
release: | ||
types: [released] | ||
|
||
jobs: | ||
ci: | ||
runs-on: windows-latest | ||
|
||
permissions: | ||
contents: write | ||
|
||
env: | ||
SOLUTION_NAME: NickJohn.WinUI.ObservableSettings.sln | ||
PACKAGE_PROJECT_NAME: NickJohn.WinUI.ObservableSettings | ||
TEST_PROJECT_NAME: NickJohn.WinUI.ObservableSettings.Test | ||
CONFIGURATION: Release | ||
PLATFORM: x64 | ||
|
||
steps: | ||
- name: 📃 Create draft release | ||
uses: ncipollo/release-action@v1 | ||
if: github.event_name == 'push' && github.ref_type == 'tag' && startsWith(github.ref_name, 'v') | ||
with: | ||
draft: true | ||
generateReleaseNotes: true | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install .NET SDK | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 7.0.x | ||
|
||
- name: Add MSBuild to PATH | ||
uses: microsoft/[email protected] | ||
|
||
- name: Add VSTest to PATH | ||
uses: darenm/[email protected] | ||
|
||
- name: Restore dependencies | ||
run: dotnet restore $env:SOLUTION_NAME | ||
|
||
- name: Build solution | ||
run: msbuild $env:SOLUTION_NAME /p:Configuration=${{ env.CONFIGURATION }} /p:Platform=${{ env.PLATFORM }} | ||
|
||
- name: 🧪 Unit testing | ||
run: vstest.console.exe test\${{ env.TEST_PROJECT_NAME }}\bin\${{ env.PLATFORM }}\${{ env.CONFIGURATION }}\*\${{ env.TEST_PROJECT_NAME }}.build.appxrecipe | ||
|
||
- name: 🚀 Publish to Nuget | ||
if: github.event_name == 'release' && github.ref_type == 'tag' && startsWith(github.ref_name, 'v') | ||
run: | | ||
$packageFile = Get-ChildItem src\${{ env.PACKAGE_PROJECT_NAME }}\bin\${{ env.CONFIGURATION }}\${{ env.PACKAGE_PROJECT_NAME }}.*.nupkg | ||
dotnet nuget push $packageFile --api-key ${{ secrets.NUGET_KEY }} --source https://api.nuget.org/v3/index.json | ||
name: ci | ||
|
||
on: | ||
push: | ||
pull_request: | ||
workflow_dispatch: | ||
release: | ||
types: [released] | ||
|
||
jobs: | ||
ci: | ||
runs-on: windows-latest | ||
|
||
permissions: | ||
contents: write | ||
|
||
env: | ||
SOLUTION_NAME: NickJohn.WinUI.ObservableSettings.sln | ||
PACKAGE_PROJECT_NAME: NickJohn.WinUI.ObservableSettings | ||
TEST_PROJECT_NAME: NickJohn.WinUI.ObservableSettings.Test | ||
CONFIGURATION: Release | ||
PLATFORM: x64 | ||
|
||
steps: | ||
- name: 📃 Create draft release | ||
uses: ncipollo/release-action@v1 | ||
if: github.event_name == 'push' && github.ref_type == 'tag' && startsWith(github.ref_name, 'v') | ||
with: | ||
draft: true | ||
generateReleaseNotes: true | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install .NET SDK | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 7.0.x | ||
|
||
- name: Add MSBuild to PATH | ||
uses: microsoft/[email protected] | ||
|
||
- name: Add VSTest to PATH | ||
uses: darenm/[email protected] | ||
|
||
- name: Restore dependencies | ||
run: dotnet restore $env:SOLUTION_NAME | ||
|
||
- name: ⚒️ Build solution | ||
run: msbuild $env:SOLUTION_NAME /p:Configuration=${{ env.CONFIGURATION }} /p:Platform=${{ env.PLATFORM }} | ||
|
||
- name: 🧪 Unit testing | ||
run: vstest.console.exe test\${{ env.TEST_PROJECT_NAME }}\bin\${{ env.PLATFORM }}\${{ env.CONFIGURATION }}\*\${{ env.TEST_PROJECT_NAME }}.build.appxrecipe | ||
|
||
- name: 🚀 Publish to Nuget | ||
if: github.event_name == 'release' && github.ref_type == 'tag' && startsWith(github.ref_name, 'v') | ||
run: | | ||
$packageFile = Get-ChildItem src\${{ env.PACKAGE_PROJECT_NAME }}\bin\${{ env.CONFIGURATION }}\${{ env.PACKAGE_PROJECT_NAME }}.*.nupkg | ||
dotnet nuget push $packageFile --api-key ${{ secrets.NUGET_KEY }} --source https://api.nuget.org/v3/index.json |
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