Skip to content

Commit 041cd14

Browse files
committed
Actions: separate CI and publish
1 parent 04c60c4 commit 041cd14

File tree

2 files changed

+42
-28
lines changed

2 files changed

+42
-28
lines changed

.github/workflows/ci.yaml

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,46 +7,24 @@ on:
77
- master
88
pull_request:
99
types: [opened, synchronize, reopened]
10-
release:
11-
types:
12-
- created
1310

1411
jobs:
1512
test:
1613
name: Test
1714
runs-on: windows-latest
15+
defaults:
16+
run:
17+
working-directory: ./src
1818
steps:
1919
- name: 🛒 Checkout
2020
uses: actions/checkout@v2
21-
- name: ✨ Setup .NET 5
22-
uses: actions/setup-dotnet@v1
23-
with:
24-
dotnet-version: "5.0.x"
2521
- name: ✨ Setup .NET 6
2622
uses: actions/setup-dotnet@v1
2723
with:
2824
dotnet-version: "6.0.x"
29-
include-prerelease: true
30-
- name: 🛠️ Setup NuGet
31-
uses: nuget/setup-nuget@v1
32-
with:
33-
nuget-api-key: ${{ secrets.NUGET_API_KEY }}
3425
- name: 🚚 Restore
35-
run: dotnet restore src
26+
run: dotnet restore
3627
- name: 🛠️ Build
37-
run: dotnet build src --configuration Release
28+
run: dotnet build
3829
- name: 🧪 Test
39-
run: dotnet test src
40-
- name: 📦 Pack
41-
run: dotnet pack src --configuration Release
42-
- name: 💾 Store
43-
uses: actions/upload-artifact@v2
44-
with:
45-
name: Packages
46-
retention-days: 1
47-
path: |
48-
src/FftSharp/bin/Release/*.nupkg
49-
src/FftSharp/bin/Release/*.snupkg
50-
- name: 🚀 Publish
51-
if: github.event_name == 'release'
52-
run: nuget push "src\FftSharp\bin\Release\*.nupkg" -SkipDuplicate -Source https://api.nuget.org/v3/index.json
30+
run: dotnet test

.github/workflows/publish.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Publish
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types:
7+
- created
8+
9+
jobs:
10+
test:
11+
name: Publish
12+
runs-on: windows-latest
13+
defaults:
14+
run:
15+
working-directory: ./src
16+
steps:
17+
- name: 🛒 Checkout
18+
uses: actions/checkout@v2
19+
- name: ✨ Setup .NET 6
20+
uses: actions/setup-dotnet@v1
21+
with:
22+
dotnet-version: "6.0.x"
23+
- name: 🛠️ Setup NuGet
24+
uses: nuget/setup-nuget@v1
25+
with:
26+
nuget-api-key: ${{ secrets.NUGET_API_KEY }}
27+
- name: 🚚 Restore
28+
run: dotnet restore
29+
- name: 🛠️ Build
30+
run: dotnet build --configuration Release
31+
- name: 🧪 Test
32+
run: dotnet test --configuration Release
33+
- name: 📦 Pack
34+
run: dotnet pack --configuration Release
35+
- name: 🚀 Publish
36+
run: nuget push "FftSharp\bin\Release\*.nupkg" -SkipDuplicate -Source https://api.nuget.org/v3/index.json

0 commit comments

Comments
 (0)