-
Notifications
You must be signed in to change notification settings - Fork 233
97 lines (83 loc) · 2.93 KB
/
demo.workflow.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
name: DepthAI Demo CI/CD
on:
workflow_dispatch:
push:
branches:
- main
tags:
- 'v*'
- '!v*-sdk'
pull_request:
branches:
- main
jobs:
windows-installer:
runs-on: windows-latest
steps:
# Clones repository without persisting credentials
# As this local git repository is packed with installer
- uses: actions/checkout@v2
with:
submodules: 'recursive'
persist-credentials: ''
- name: Get tag version
id: tag
uses: battila7/get-version-action@v2
- name: Set version (Release)
if: startsWith(github.ref, 'refs/tags/v') == true
run: echo '#define MyAppVersion "${{ steps.tag.outputs.version-without-v }}"' > launcher/windows/version.txt
- name: Set version
if: startsWith(github.ref, 'refs/tags/v') != true
run: echo '#define MyAppVersion "1.0-${{ github.sha }}"' > launcher/windows/version.txt
- name: Build Windows Installer
run: .\launcher\windows\build.ps1
- name: Upload Installer artifact
uses: actions/upload-artifact@v2
with:
name: installers
path: launcher/windows/build/Output/
retention-days: 5
release:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: windows-latest
needs: windows-installer
steps:
- name: Download Windows installer
uses: actions/download-artifact@v2
with:
name: 'installers'
path: installers
# Sign Launcher
- name: Sign Windows Launcher
run: |
New-Item -ItemType directory -Path certificate
Set-Content -Path certificate\certificate.txt -Value '${{ secrets.WINDOWS_CERTIFICATE }}'
certutil -decode certificate\certificate.txt certificate\certificate.pfx
& 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe' sign /td sha256 /fd sha256 /f certificate\certificate.pfx /p '${{ secrets.WINDOWS_CERTIFICATE_PASS }}' /tr http://timestamp.digicert.com installers/DepthAI_setup.exe
- name: Get current tag
id: tag
uses: battila7/get-version-action@v2
# Create GitHub release
- uses: actions/create-release@master
id: createRelease
name: Create ${{ steps.tag.outputs.version }} DepthAI Demo release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tag.outputs.version }}
release_name: DepthAI Demo ${{ steps.tag.outputs.version }}
body: |
## Features
## Bugs
## Misc
draft: true
# Upload release assets
- name: Upload Windows Installer
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.createRelease.outputs.upload_url }}
asset_path: ${{ github.workspace }}\installers\DepthAI_setup.exe
asset_name: DepthAI-setup-${{ steps.tag.outputs.version }}.exe
asset_content_type: application/octet-stream