-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (67 loc) · 2.08 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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