Skip to content

Add cake

Add cake #1

Workflow file for this run

# ITNOA
# Based on https://github.com/flcdrg/VsShowMissing
name: CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
env:
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
strategy:
matrix:
include:
- solution: BSN.IpTables.Api.sln
os: windows-2022
artifact: VS2022
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
outputs:
GitAssemblyInformationalVersion: ${{ steps.gitversion.outputs.GitAssemblyInformationalVersion }}
GitBuildVersion: ${{ steps.gitversion.outputs.GitBuildVersion }}
GitBuildVersionSimple: ${{ steps.gitversion.outputs.GitBuildVersionSimple }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/cache@v3
with:
path: ${{ github.workspace }}/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: setup-msbuild
uses: microsoft/setup-msbuild@v1
- name: nuget restore
run: nuget restore -Verbosity quiet
- name: Build
id: build
run: |
msbuild /p:configuration=Release /p:DeployExtension=false /p:ZipPackageCompressionLevel=normal /v:m ${{ matrix.solution }}
- name: gitversion
id: gitversion
run: |
dir env:
echo "::set-output name=GitAssemblyInformationalVersion::$($env:GitAssemblyInformationalVersion)"
echo "::set-output name=GitBuildVersion::$($env:GitBuildVersion)"
echo "::set-output name=GitBuildVersionSimple::$($env:GitBuildVersionSimple)"
- name: Upload a Build Artifact
uses: actions/upload-artifact@v3
with:
# Artifact name
name: ${{ matrix.artifact }}
# A file, directory or wildcard pattern that describes what to upload
path: '**/Release/*.vsix'
- name: Test
run: dotnet test --no-restore --verbosity normal
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: |
test-results/**/*.xml
test-results/**/*.trx
test-results/**/*.json
- name: Dump steps context
env:
STEPS_CONTEXT: ${{ toJson(steps) }}
run: echo "$STEPS_CONTEXT"
update_release_draft:
name: Update release draft
runs-on: ubuntu-latest
needs: [build]
env:
GitAssemblyInformationalVersion: ${{ needs.build.outputs.GitAssemblyInformationalVersion }}
GitBuildVersion: ${{ needs.build.outputs.GitBuildVersion }}
GitBuildVersionSimple: ${{ needs.build.outputs.GitBuildVersionSimple }}
if: github.ref == 'refs/heads/main' # Running this job only for master branch
steps:
- uses: actions/checkout@v3
- uses: release-drafter/release-drafter@v5
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
version: ${{ needs.build.outputs.GitBuildVersionSimple }}