Skip to content

Publish packages from PR #: #1

Publish packages from PR #:

Publish packages from PR #: #1

Workflow file for this run

name: Publish
run-name: 'Publish packages from PR #${{ github.event.pull_request.number }}: ${{ github.event.pull_request.title }}'
on:
workflow_dispatch:
pull_request:
types:
- closed
branches:
- 'main'
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Test
run: dotnet test src/Medo.Uuid7.sln
publish:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v3.0.0
with:
versionSpec: '6.x'
- name: Version
id: gitversion
uses: gittools/actions/gitversion/execute@v0
- name: Build
run: dotnet build src/Medo.Uuid7.sln
- name: Package for Nuget
run: 'dotnet pack src/Medo.Uuid7.sln -p:PackageVersion=$PACKAGE_VERSION -o ./'
env:
PACKAGE_VERSION: ${{steps.gitversion.outputs.nuGetVersionV2}}
# - name: Publish
# run: dotnet nuget push *.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json