Skip to content

Commit

Permalink
update work flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Railway committed Oct 27, 2022
1 parent e4f31f2 commit 1245fed
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 25 deletions.
26 changes: 1 addition & 25 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: .NET
name: .NET Package test

on:
push:
Expand Down Expand Up @@ -32,27 +32,3 @@ jobs:
run: |
& cd MauiAudio
& dotnet pack --no-restore --configuration Release
- name: Setup NuGet.exe for use with actions
uses: NuGet/setup-nuget@v1.0.6

# - 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 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/publish-nuget@v2.5.5
# with:
# PROJECT_FILE_PATH: MauiAudio.csproj
# NUGET_KEY: ${{ secrets.NugetKey }}

58 changes: 58 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: .NET Nuget Publish

on:
push:
branches: [ "master" ]
tags:
- v*
env:
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: |
& 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: |
& cd MauiAudio
& dotnet restore
- name: Build
run: |
& cd MauiAudio
& dotnet pack --no-restore --configuration Release
- name: Setup NuGet.exe for use with actions
uses: NuGet/setup-nuget@v1.0.6

# - 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 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/publish-nuget@v2.5.5
# with:
# PROJECT_FILE_PATH: MauiAudio.csproj
# NUGET_KEY: ${{ secrets.NugetKey }}

0 comments on commit 1245fed

Please sign in to comment.