Build and release to repository #43
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
run-name: Build and release to repository | |
on: | |
push: | |
tags: | |
- v** | |
- latest | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: 'Version tag (latest if none provided)' | |
required: false | |
default: latest | |
type: string | |
jobs: | |
build: | |
name: Build WatchDog | |
runs-on: windows-2022 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.ref.name || inputs.tag }} | |
- name: Restore NuGet dependencies | |
shell: powershell | |
run: 'C:\Program` Files\Microsoft` Visual` Studio\2022\Enterprise\MSBuild\Current\Bin\msbuild.exe -t:restore' | |
- name: Build binary | |
shell: powershell | |
run: 'C:\Program` Files\Microsoft` Visual` Studio\2022\Enterprise\MSBuild\Current\Bin\msbuild.exe AMRPC` WatchDog` Desktop.sln /p:Configuration=Release' | |
- name: Compress binary | |
shell: powershell | |
run: ' Compress-Archive .\WatchDog\bin\Release\* watchdog.zip' | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: watchdog-build | |
path: watchdog.zip | |
create_release: | |
name: Create release | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.ref.name || inputs.tag }} | |
- uses: actions/download-artifact@v2 | |
with: | |
name: watchdog-build | |
- name: Create release | |
id: create_release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: 'watchdog.zip' | |
tag: ${{ github.ref.name || inputs.tag }} | |
replacesArtifacts: true | |
allowUpdates: true | |
bodyFile: "install_instructions.md" |