Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/prereleasenuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Publish Pre-Release Nuget

on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- master

jobs:
build:
name: "Publish Pre-Release Nugets"
env:
ASPNETCORE_ENVIRONMENT: "Production"

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1

- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.102

- name: Restore Nuget Packages
run: dotnet restore TransactionProcessorACL.sln --source https://api.nuget.org/v3/index.json --source https://www.myget.org/F/transactionprocessing/api/v3/index.json

- name: Build Code
run: dotnet build TransactionProcessorACL.sln --configuration Release

- name: Get the last version
id: get_version
run: echo ::set-output name=VERSION::$(git tag --sort=committerdate | tail -1)

- name: Print Version
id: next_version
run: echo ::set-output name=VERSION::${{ steps.get_version.outputs.VERSION }}-build$GITHUB_RUN_NUMBER

- name: Build and Publish Nuget Packages
run: |
dotnet pack "TransactionProcessorACL.DataTransferObjects\TransactionProcessorACL.DataTransferObjects.csproj" /p:PackageVersion=${{ steps.get_version.outputs.VERSION }} --output Nugets
dotnet nuget push Nugets/TransactionProcessorACL.DataTransferObjects.${{ steps.get_version.outputs.VERSION }}.nupkg --api-key ${{ secrets.MYGET_APIKEY }} --source https://www.myget.org/F/transactionprocessing/api/v2/package