-
Notifications
You must be signed in to change notification settings - Fork 1
78 lines (64 loc) · 2.17 KB
/
release-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
69
70
71
72
73
74
75
76
77
78
# This workflow build the release version of AutoTx.
# It uses the Github runner `windows-2019`, which still supports .Net framework 4
# according to this page:
# https://github.com/orgs/community/discussions/25253
name: .NET Core Desktop
on:
push:
branches:
- "feature/20240305-setup-github-actions"
# push:
# tags:
# - "*.*"
jobs:
build:
strategy:
matrix:
# configuration: [Debug, Release] # commented this for the moment, because below msbuild is called with "Release" config
configuration: [Debug]
# this is the last Github runner VM that supports .Net Framework 2019
runs-on: windows-2019
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
lfs: "true"
- name: setup-msbuild
uses: microsoft/setup-msbuild@v2
- name: Setup NuGet.exe for use with actions
uses: NuGet/[email protected]
- name: setup-msbuild
uses: microsoft/setup-msbuild@v2
- name: Restore Packages
run: nuget restore AutoTx.sln
- name: Build solution
run: .\Scripts\msbuild\build\release.cmd
- name: Package release
run: .\Scripts\Make-Package.ps1
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }} # Use the tag name
release_name: Release ${{ github.ref_name }}
body: |
Description of the release.
draft: false
prerelease: false
- name: Find the built ZIP file
id: find_zip
run: |
ZIP_FILE=$(find ./path/to/your/ -name "asset_*.zip" -print -quit)
echo "ZIP_FILE=$ZIP_FILE" >> $GITHUB_ENV
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.ZIP_FILE }}
asset_name: $(basename ${{ env.ZIP_FILE }})
asset_content_type: application/zip