Remove V2 from the header #35
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build & Release | |
on: | |
push: | |
tags: ["v*.*.*"] | |
jobs: | |
release: | |
name: Build & Release | |
runs-on: ubuntu-latest | |
env: | |
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 | |
DOTNET_CLI_TELEMETRY_OPTOUT: 1 | |
steps: | |
- name: Get the version | |
id: get_version | |
run: echo ::set-output name=version::$(echo $GITHUB_REF | cut -d / -f 3 | cut -c2-) | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
lfs: true | |
- name: Setup .NET 6.0 | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 6.0.x | |
- name: Setup .NET 7.0 | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 7.0.x | |
- name: Restore | |
run: dotnet restore | |
- name: Build | |
env: | |
BUILD_VERSION: ${{ steps.get_version.outputs.version }} | |
run: dotnet build --no-restore --configuration Release | |
- name: Test | |
env: | |
BUILD_VERSION: ${{ steps.get_version.outputs.version }} | |
run: dotnet test --configuration Release | |
- name: Publish | |
env: | |
BUILD_VERSION: ${{ steps.get_version.outputs.version }} | |
working-directory: src/LeanCode.ContractsGenerator | |
run: dotnet publish --output ./publish --no-self-contained --no-build --configuration Release --framework net6.0 | |
- name: Pack | |
env: | |
BUILD_VERSION: ${{ steps.get_version.outputs.version }} | |
working-directory: src/LeanCode.ContractsGenerator/publish | |
run: zip --recurse-paths "../../../LeanCode.ContractsGenerator.${BUILD_VERSION}.zip" . | |
- name: Pack Global Tool | |
env: | |
BUILD_VERSION: ${{ steps.get_version.outputs.version }} | |
working-directory: src/LeanCode.ContractsGenerator | |
run: dotnet pack --no-build -c Release -o . -p:PackAsGlobalTool=true | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
name: ${{ format('Release v{0}', steps.get_version.outputs.version) }} | |
tag_name: ${{ format('v{0}', steps.get_version.outputs.version) }} | |
files: | | |
${{ format('./LeanCode.ContractsGenerator.{0}.zip', steps.get_version.outputs.version) }} | |
${{ format('./dotnet-contracts-generate.{0}.zip', steps.get_version.outputs.version) }} | |
- name: Push Global Tool | |
env: | |
BUILD_VERSION: ${{ steps.get_version.outputs.version }} | |
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | |
working-directory: src/LeanCode.ContractsGenerator | |
run: dotnet nuget push "dotnet-contracts-generate.${BUILD_VERSION}.nupkg" -k "${NUGET_API_KEY}" -s 'https://api.nuget.org/v3/index.json' -n |