Skip to content

Merge pull request #19 from leancodepl/publisher/add-test-client-to-cd #6

Merge pull request #19 from leancodepl/publisher/add-test-client-to-cd

Merge pull request #19 from leancodepl/publisher/add-test-client-to-cd #6

Workflow file for this run

name: Publisher Build & Publish to feedz
on:
push:
tags: ["v*.*.*"]
jobs:
release:
name: Build & Release
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./publisher
env:
DOTNET_VERSION: 8.0.1xx
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
steps:
- name: Version
id: version
run: echo ::set-output name=version::$(echo $GITHUB_REF | cut -d / -f 3 | cut -c2-)
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-restore -c Release
- name: Pack Publisher
env:
BUILD_VERSION: ${{ steps.version.outputs.version }}
run: dotnet pack --no-build -c Release
working-directory: ./publisher/src/LeanPipe
- name: Pack Test Client
env:
BUILD_VERSION: ${{ steps.version.outputs.version }}
run: dotnet pack --no-build -c Release
working-directory: ./publisher/src/LeanPipe.TestClient
- name: Publish to Feedz
run: |
dotnet nuget push \
"src/LeanPipe/bin/Release/LeanPipe.${BUILD_VERSION}.nupkg" \
"src/LeanPipe.TestClient/bin/Release/LeanPipe.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 }}