forked from RAvenGEr/PTZControl
-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (82 loc) · 2.86 KB
/
gh-release.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: Build and Release PTZControl
on:
push:
tags:
- 'v*'
jobs:
build-x64:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Setup MSBuild path
uses: microsoft/setup-msbuild@v1.0.2
- name: Restore NuGet packages
run: nuget restore PTZControl/PTZControl.sln
- name: Build the PTZControl project (x64)
run: msbuild PTZControl/PTZControl.sln /p:Configuration=Release /p:Platform=x64
- name: Upload PTZControl (x64) as artifact
uses: actions/upload-artifact@v2
with:
name: PTZControl-x64
path: ${{ github.workspace }}\PTZControl\x64\Release\PTZControl.exe
build-x86:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Setup MSBuild path
uses: microsoft/setup-msbuild@v1.0.2
- name: Restore NuGet packages
run: nuget restore PTZControl/PTZControl.sln
- name: Build the PTZControl project (x86)
run: msbuild PTZControl/PTZControl.sln /p:Configuration=Release /p:Platform=x86
- name: Upload PTZControl (x86) as artifact
uses: actions/upload-artifact@v2
with:
name: PTZControl-x86
path: ${{ github.workspace }}\PTZControl\Release\PTZControl.exe
create-release:
needs: [build-x64, build-x86]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v2
- name: Extract Tag Name
id: tagname
run: echo "TAG_NAME=$(echo ${{ github.ref }} | sed 's/refs\/tags\///')" >> $GITHUB_ENV
- name: Download x64 artifact
uses: actions/download-artifact@v2
with:
name: PTZControl-x64
- name: Move x64 Artifact
run: |
mkdir -p PTZControl-${{ env.TAG_NAME }}/x64
mv ./PTZControl.exe PTZControl-${{ env.TAG_NAME }}/x64/
- name: Download x86 artifact
uses: actions/download-artifact@v2
with:
name: PTZControl-x86
- name: Move x86 Artifact
run: |
mkdir -p PTZControl-${{ env.TAG_NAME }}/x86
mv ./PTZControl.exe PTZControl-${{ env.TAG_NAME }}/x86/
- name: Zip Files
run: zip -r PTZControl.zip PTZControl-${{ env.TAG_NAME }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.TAG_NAME }}
release_name: PTZControl ${{ env.TAG_NAME }}
draft: false
prerelease: false
- 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: ./PTZControl.zip
asset_name: PTZControl.zip
asset_content_type: application/zip