Skip to content

MsiZapEx Build

MsiZapEx Build #53

Workflow file for this run

name: MsiZapEx Build
on:
workflow_dispatch:
inputs:
publish_nuget:
description: 'Publish nuget package?'
required: true
default: false
type: boolean
publish_release:
description: 'Publish release?'
required: true
default: false
type: boolean
version:
description: 'Build & package version'
required: true
default: 0.2.4
type: string
jobs:
Build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4.1.7
- uses: microsoft/setup-msbuild@v2
- name: Set version
run: Add-Content -Path $env:GITHUB_ENV -Value "FULL_VERSION=${{ github.event.inputs.version }}.${{ github.run_number }}"
- name: Build
run: dotnet build MsiZapEx.sln -p:Configuration=Release -p:Version=${{ env.FULL_VERSION }}
- name: Publish artifacts
uses: actions/upload-artifact@v3.0.0
with:
name: MsiZapEx
path: |
build/net40/MsiZapEx/Release/bin/*.exe
build/net40/MsiZapEx/Release/bin/*.dll
- name: Publish nuget packages to github and nuget.org
if: ${{ github.event.inputs.publish_nuget == 'true' }}
run: |
dotnet pack MsiZapEx.sln -p:Configuration=Release -p:Version=${{ env.FULL_VERSION }}
dotnet nuget add source --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
dotnet nuget push build\MsiZapEx\Release\bin\MsiZapEx.${{ env.FULL_VERSION }}.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source github
dotnet nuget push build\MsiZapEx\Release\bin\MsiZapEx.${{ env.FULL_VERSION }}.nupkg --api-key ${{ secrets.NUGET_TOKEN }} --source https://api.nuget.org/v3/index.json
- name: Publish release
uses: softprops/action-gh-release@v2.0.8
if: ${{ github.event.inputs.publish_release == 'true' }}
with:
prerelease: false
generate_release_notes: true
tag_name: ${{ env.FULL_VERSION }}
files: |
build\MsiZapEx\Release\bin\MsiZapEx.${{ env.FULL_VERSION }}.nupkg
build/net40/MsiZapEx/Release/bin/MsiZapEx.exe
build/net40/MsiZapEx/Release/bin/CommandLine.dll