Skip to content

PR EntityTableClient - chore/tableclient refact internal dependencies… #86

PR EntityTableClient - chore/tableclient refact internal dependencies…

PR EntityTableClient - chore/tableclient refact internal dependencies… #86

name: preview and release publish
on:
push:
branches: [ main ]
paths: [src/**]
tags:
- v[0-9]+.[0-9]+.[0-9]+
env:
AZURE_ARTIFACTS_FEED_URL: https://api.nuget.org/v3/index.json
BUILD_CONFIGURATION: 'Release' # set this to the appropriate build configuration
DOTNET_VERSION: '6.x'
TEST_STORAGE_CONNECTION_STRING: ${{ secrets.TEST_STORAGE_CONNECTION_STRING }}
MinVerMinimumMajorMinor: '1.1'
MinVerTagPrefix: 'v'
MinVerDefaultPreReleaseIdentifiers : 'preview.0'
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checkout the repo
- uses: actions/checkout@v2
with:
fetch-depth: 0
# Retrieve minVer version
- name: Set APP_VERSION based on repo w/MinVer
run: |
dotnet tool install -g minver-cli -v q
APP_VERSION=`minver`
echo "Adding version to GITHUB_ENV: APP_VERSION=$APP_VERSION"
echo "APP_VERSION=$APP_VERSION" >> $GITHUB_ENV
# Setup .NET Core SDK
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
# Install Azure sorage emulator
- name: Setup Node.js environment
uses: actions/[email protected]
- name: Install & run Azurite
run: npm install -g azurite
- name: Run Azurite in Background
shell: bash
run: azurite -L &
# Run dotnet build and package
- name: dotnet build and test
run: |
dotnet restore
dotnet build --configuration '${{ env.BUILD_CONFIGURATION }}'
dotnet test --configuration '${{ env.BUILD_CONFIGURATION }}' -v n
az-artifacts-build-and-deploy:
needs: build
runs-on: ubuntu-latest
steps:
# Checkout the repo
- uses: actions/checkout@v2
with:
fetch-depth: 0
# Retrieve minVer version
- name: Set APP_VERSION based on repo w/MinVer
run: |
dotnet tool install -g minver-cli -v q
APP_VERSION=`minver`
echo "Adding version to GITHUB_ENV: APP_VERSION=$APP_VERSION"
echo "APP_VERSION=$APP_VERSION" >> $GITHUB_ENV
# Run dotnet build and package
- name: dotnet build and publish
run: |
dotnet restore
dotnet build --configuration '${{ env.BUILD_CONFIGURATION }}' --version-suffix '${{ env.APP_VERSION }}'
dotnet pack -c '${{ env.BUILD_CONFIGURATION }}' --no-build --version-suffix '${{ env.APP_VERSION }}'
# Publish the package to Azure Artifacts
- name: 'dotnet publish'
run: dotnet nuget push src/Azure.EntityServices.*/bin/Release/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json