Skip to content

Merge pull request #27 from leancodepl/publisher/topic-keys-redesign #7

Merge pull request #27 from leancodepl/publisher/topic-keys-redesign

Merge pull request #27 from leancodepl/publisher/topic-keys-redesign #7

Workflow file for this run

name: Publisher Build & Publish to feedz
on:
push:
tags: ["publisher-v*.*.*"]
jobs:
release:
name: Build & Release
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./publisher
env:
DOTNET_VERSION: 8.0.100-rc.1.23463.5
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
steps:
- name: Version
id: version
run: |
VERSION=${GITHUB_REF#refs/tags/publisher-v}
if ! [[ ${VERSION} =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9\.]+)?$ ]]
then
echo 1>&2 "Invalid version: ${VERSION}"
exit 1
fi
echo ::set-output name=version::${VERSION}
working-directory: .
- name: Checkout
uses: actions/checkout@v3
- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Restore
run: dotnet restore
- name: Build
env:
BUILD_VERSION: ${{ steps.version.outputs.version }}
run: dotnet build --no-restore -c Release
- name: Test
env:
BUILD_VERSION: ${{ steps.version.outputs.version }}
run: dotnet test --no-build -c Release
- name: Pack Publisher
env:
BUILD_VERSION: ${{ steps.version.outputs.version }}
run: dotnet pack --no-build -c Release
working-directory: ./publisher/src/LeanCode.Pipe
- name: Pack Test Client
env:
BUILD_VERSION: ${{ steps.version.outputs.version }}
run: dotnet pack --no-build -c Release
working-directory: ./publisher/src/LeanCode.Pipe.TestClient
- name: Publish to Feedz
run: |
dotnet nuget push \
"src/LeanCode.Pipe/bin/Release/LeanCode.Pipe.${BUILD_VERSION}.nupkg" \
"src/LeanCode.Pipe.TestClient/bin/Release/LeanCode.Pipe.TestClient.${BUILD_VERSION}.nupkg" \
-k "$FEEDZ_API_KEY" \
-s 'https://f.feedz.io/leancode/public/nuget/index.json' \
-n
env:
BUILD_VERSION: ${{ steps.version.outputs.version }}
FEEDZ_API_KEY: ${{ secrets.FEEDZ_API_KEY }}