Skip to content

Commit

Permalink
change the workflow condition
Browse files Browse the repository at this point in the history
  • Loading branch information
Railway committed Nov 14, 2022
1 parent ba8aeb3 commit 0ee672b
Showing 1 changed file with 30 additions and 32 deletions.
62 changes: 30 additions & 32 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,54 +2,52 @@ name: .NET Nuget Publish

on:
push:
branches: [ "master" ]
tags:
- v*
env:
DOTNETVERSION: 6.0.300
DOTNETVERSION: 6.0.300
jobs:
build:

runs-on: windows-2022

steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: '${{env.DOTNETVERSION}}'
- name: Install .NET MAUI
shell: pwsh
run: |
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: "${{env.DOTNETVERSION}}"
- name: Install .NET MAUI
shell: pwsh
run: |
& dotnet nuget locals all --clear
& dotnet workload install maui --source https://aka.ms/dotnet6/nuget/index.json --source https://api.nuget.org/v3/index.json
# & dotnet workload install android ios maccatalyst tvos macos maui wasm-tools maui-maccatalyst --source https://aka.ms/dotnet6/nuget/index.json --source https://api.nuget.org/v3/index.json
- name: Restore dependencies
run: |
- name: Restore dependencies
run: |
& cd MauiAudio
& dotnet restore
- name: Build
run: |
- name: Build
run: |
& cd MauiAudio
& dotnet pack --no-restore --configuration Release
- name: Setup NuGet.exe for use with actions
uses: NuGet/[email protected]

# - name: 添加github仓库
# run: |
# nuget sources add -name github -Source https://nuget.pkg.github.com/BeautifulPilgrim/index.json -Username BeautifulPilgrim -Password ${{ secrets.GitHubToken }}
- name: list
run: |
cd MauiAudio
dir ./bin/Release
- name: 发布生成包到github和nuget
run: |
cd MauiAudio
nuget push **/*.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NugetKey }} -NoSymbol
- name: Setup NuGet.exe for use with actions
uses: NuGet/[email protected]

# - name: 添加github仓库
# run: |
# nuget sources add -name github -Source https://nuget.pkg.github.com/BeautifulPilgrim/index.json -Username BeautifulPilgrim -Password ${{ secrets.GitHubToken }}
- name: list
run: |
cd MauiAudio
dir ./bin/Release
- name: 发布生成包到github和nuget
run: |
cd MauiAudio
nuget push **/*.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NugetKey }} -NoSymbol
# nuget push ./bin/Release/*.nupkg -Source github -SkipDuplicate

# nuget push ./bin/Release/*.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NugetKey }} -NoSymbol
# nuget push ./bin/Release/*.nupkg -Source github -SkipDuplicate

# - name: Publish NuGet
# uses: brandedoutcast/[email protected]
# with:
Expand Down

0 comments on commit 0ee672b

Please sign in to comment.