Skip to content

Migrate renovate config #275

Migrate renovate config

Migrate renovate config #275

Workflow file for this run

name: build
on:
push:
branches: [ "main" ]
tags:
- "v*"
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Calculate application version
id: build-version
uses: actions/github-script@v7
with:
script: |
const toStrip = "refs/tags/v";
return context.ref.substring(toStrip.length)
result-encoding: string
- name: Print version
run: echo "${{ steps.build-version.outputs.result }}"
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Restore dependencies
run: dotnet restore
- name: Check format
run: dotnet format --no-restore --verify-no-changes
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
publish:
if: startsWith(github.event.ref, 'refs/tags/v')
environment: nuget
runs-on: ubuntu-latest
needs: build
steps:
- name: Clone repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Get version
id: build-version
uses: actions/github-script@v7
with:
script: |
const versionPrefix = "refs/tags/v";
return context.ref.substring(versionPrefix.length)
result-encoding: string
- name: Print version
run: echo "${{ steps.build-version.outputs.result }}"
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build -c RELEASE -p:ContinuousIntegrationBuild=true -p:version=${{ steps.build-version.outputs.result }} --no-restore
- name: Create nuget package
run: dotnet pack -c RELEASE --no-build -p:packageVersion=${{ steps.build-version.outputs.result }} -p:RepositoryBranch=${GITHUB_REF#refs/*/} -p:RepositoryCommit=${GITHUB_SHA} --no-restore
- name: Publish package to nuget
run: dotnet nuget push "${GITHUB_WORKSPACE}/src/AzOps.Sb/nupkg/az-ops-sb.${{ steps.build-version.outputs.result }}.nupkg" --api-key "${{ secrets.NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate