Build #54
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 | |
on: | |
workflow_dispatch: | |
inputs: | |
version_number: | |
description: 'Version Number' | |
required: true | |
type: string | |
info: | |
description: 'Description of this Release' | |
required: true | |
type: string | |
tags: | |
- 'v*' | |
jobs: | |
build: | |
name: Create build | |
runs-on: windows-2022 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup MSBuild | |
uses: microsoft/[email protected] | |
- name: Restore NuGet packages | |
run: nuget restore src/pbtgui.sln | |
- name: Build executable | |
run: msbuild /t:build /p:Configuration=Release src/pbtgui.sln | |
- name: Create zip file | |
run: | | |
Compress-Archive -Path "src/bin/Release/pbtgui.exe", "src/bin/Release/Newtonsoft.Json.dll" -DestinationPath "src/bin/Release/paperback-themes-gui.zip" | |
- name: Create artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: paperback-themes-gui | |
path: src/bin/Release/paperback-themes-gui.zip | |
if-no-files-found: error | |
release: | |
name: Create Release | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Download Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: paperback-themes-gui | |
path: src/bin/Release | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.event.inputs.version_number }} | |
release_name: v${{ github.event.inputs.version_number }} | |
draft: false | |
prerelease: false | |
body: | | |
${{ github.event.inputs.info }} | |
- name: Upload executable | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: src/bin/Release/paperback-themes-gui.zip | |
asset_name: paperback-themes-gui.zip | |
asset_content_type: application/zip |