Skip to content

Commit

Permalink
Update publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
gislikonrad authored Sep 24, 2021
1 parent 0e5d8ac commit 76396aa
Showing 1 changed file with 45 additions and 23 deletions.
68 changes: 45 additions & 23 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,56 @@
name: publish 0.1.x to nuget
name: publish
on:
push:
branches:
- master # Default release branch

workflow_dispatch:
inputs:
incremented-value:
description: 'The part of the version number to increment.'
required: true
default: 'patch'
prerelease:
description: 'The prerelease part of the version number.'
required: false
default: ''
metadata:
description: 'The metadata part of the version number.'
required: false
default: ''
env:
version: 0.1.${{ github.run_number }}
package_version: 0.1.${{ github.run_number }}-beta

DOTNET_ROLL_FORWARD_ON_NO_CANDIDATE_FX: '2'
jobs:
publish:
name: build, test, pack, & publish
name: publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Semver tags
id: semver
uses: SOLIDSoftworks/semver-tags@1.0.2
with:
# The github token.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
incremented-value: ${{ github.event.inputs.incremented-value }}
prerelease: ${{ github.event.inputs.prerelease }}
metadata: ${{ github.event.inputs.metadata }}

- name: Setup dotnet
- name: setup_dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.200

- name: Install dependencies
run: dotnet restore ./src/Solid.Identity.Protocols.WsTrust.sln
- name: Build
run: dotnet build ./src/Solid.Identity.Protocols.WsTrust.sln --configuration Release --no-restore -p:VersionPrefix=${{ env.version }}
- name: Test
run: dotnet test ./src/Solid.Identity.Protocols.WsTrust.sln --configuration Release --no-restore --no-build
- name: Package
run: dotnet pack ./src/Solid.Identity.Protocols.WsTrust.sln --configuration Release --no-build -p:Version=${{ env.package_version }} -o ./
- name: Push
dotnet-version: 3.1.200

- name: install_dependencies
run: dotnet restore ./src

- name: build
run: dotnet build ./src --configuration Release --no-restore -p:VersionPrefix=${{ steps.semver.outputs.core-version }}

- name: test
run: dotnet test ./src --configuration Release --no-restore --no-build

- name: package
run: dotnet pack ./src --configuration Release --no-build -p:Version=${{ steps.semver.outputs.semantic-version }} -o ./

- name: push
run: |
dotnet nuget push Solid.Identity.Protocols.WsTrust.${{env.package_version}}.nupkg -s https://api.nuget.org/v3/index.json --api-key ${{secrets.NUGET_API_KEY}}
dotnet nuget push Solid.ServiceModel.Security.WsTrust.${{env.package_version}}.nupkg -s https://api.nuget.org/v3/index.json --api-key ${{secrets.NUGET_API_KEY}}
dotnet nuget push Solid.Identity.Protocols.WsTrust.${{steps.semver.outputs.semantic-version}}.nupkg -s https://api.nuget.org/v3/index.json --api-key ${{secrets.NUGET_API_KEY}}
dotnet nuget push Solid.ServiceModel.Security.WsTrust.${{steps.semver.outputs.semantic-version}}.nupkg -s https://api.nuget.org/v3/index.json --api-key ${{secrets.NUGET_API_KEY}}

0 comments on commit 76396aa

Please sign in to comment.