Speperated test and publish pipeline

This commit is contained in:
Felix Weiß
2023-06-16 11:18:08 +02:00
parent ad61361008
commit 3dea18d285
2 changed files with 46 additions and 30 deletions

44
.github/workflows/publish-pipeline.yml vendored Normal file
View File

@@ -0,0 +1,44 @@
name: Publish pipeline
on:
workflow_dispatch:
release:
types: [published]
permissions: write-all
jobs:
test-pipeline:
name: 'Invoke the test pipeline'
uses: ./.github/workflows/test-pipeline.yml
secrets: inherit
#Deploy package
publish-package:
name: 'Build and publish package'
needs: test-pipeline
runs-on: [self-hosted, linux, x64, womed-local-linux]
steps:
- uses: actions/checkout@v3
- name: Set .csproj version to ${{github.ref_name}}
run: sed -i "s/\(<Version>\([0-9]\+\.\)\{2\}\)\([0-9]\+\)/\1${{github.ref_name}}/" MewtocolNet/MewtocolNet.csproj
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: '6.0.x'
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build "MewtocolNet"
- name: Pack
run: dotnet pack "MewtocolNet"
- name: Publish
run: |
cd '${{ github.workspace }}/Builds'
dotnet nuget push "*.nupkg" --skip-duplicate --api-key ${{ secrets.GITHUB_TOKEN }} --source "https://nuget.pkg.github.com/WOmed/index.json"

View File

@@ -1,4 +1,4 @@
name: Build pipeline
name: Test pipeline
on:
workflow_dispatch:
@@ -47,31 +47,3 @@ jobs:
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
#Deplay package
publish-package:
name: 'Build and publish package'
needs: [run-unit-tests, ]
runs-on: [self-hosted, linux, x64, womed-local-linux]
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: '6.0.x'
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build "MewtocolNet"
- name: Pack
run: dotnet pack "MewtocolNet"
- name: Publish
run: |
cd '${{ github.workspace }}/Builds'
dotnet nuget push "*.nupkg" --skip-duplicate --api-key ${{ secrets.GITHUB_TOKEN }} --source "https://nuget.pkg.github.com/WOmed/index.json"
#dotnet nuget push "*.nupkg" --skip-duplicate --api-key ${{ secrets.NUGET_KEY }} --source "https://api.nuget.org"