forked from OpenVPN/openvpn-build
-
Notifications
You must be signed in to change notification settings - Fork 0
119 lines (98 loc) · 3.58 KB
/
build.yaml
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# The name of our workflow
name: Build
on:
push:
pull_request:
repository_dispatch:
types: [openvpn-commit]
jobs:
msvc:
strategy:
matrix:
arch: [x86, amd64, arm64]
env:
CMAKE: cmake.exe
VCPKG_ROOT: ${{ github.workspace }}\vcpkg
OSSL: ossl3
VCPKG_OVERLAY_PORTS: ${{ github.workspace }}\openvpn-build\windows-msi\vcpkg-ports
WIX: ${{ github.workspace }}\wix\
name: 'openvpn-build'
runs-on: windows-2019
steps:
- name: Checkout openvpn-build
uses: actions/checkout@v2
with:
path: openvpn-build
- name: Checkout openvpn
uses: actions/checkout@v2
with:
repository: openvpn/openvpn
ref: master
path: openvpn
- name: Checkout openvpn-gui
uses: actions/checkout@v2
with:
repository: openvpn/openvpn-gui
path: openvpn-gui
- name: Checkout vcpkg
uses: actions/checkout@v2
with:
repository: microsoft/vcpkg
path: vcpkg
fetch-depth: 0
- name: Get latest CMake and ninja
uses: lukka/get-cmake@latest
- name: Install rst2html
run: python -m pip install --upgrade pip rst2html
- name: Setup MSVC prompt
uses: ilammy/msvc-dev-cmd@v1
- name: Install Wix 3.14
run: |
Invoke-WebRequest -Uri "https://wixdl.blob.core.windows.net/releases/v3.14.0.5722/wix314-binaries.zip" -OutFile wix.zip
Expand-Archive -Path .\wix.zip -DestinationPath wix\bin
- name: Build
working-directory: openvpn-build/windows-msi
run: |
New-Item -Name build-and-package-env.ps1 -ItemType File
./build-and-package.ps1 -basedir ../.. -ossl ossl3 -nosign -arch ${{ matrix.arch }} -nodevprompt
- name: Get openvpn commit id
working-directory: openvpn
run: |
$commit = git rev-parse --short HEAD
echo "OPENVPN_COMMIT=$commit" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
- name: Get datetime
run: |
$dt = Get-Date -Format "yyyyMMddThhmm"
echo "DATETIME=${dt}" >> $Env:GITHUB_ENV
- name: Archive artifacts
uses: actions/upload-artifact@v2
with:
name: openvpn-master-${{ env.DATETIME }}-${{ env.OPENVPN_COMMIT }}-${{ matrix.arch }}
path: ${{ github.workspace }}\openvpn-build\windows-msi\image\*-${{ matrix.arch }}.msi
upload_msis:
needs: msvc
name: upload-msis
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' && github.repository == 'openvpn/openvpn-build' }}
steps:
- name: Install knock
run: sudo apt install knockd
- name: Get artifacts
uses: actions/download-artifact@v3
with:
path: msi
- name: Flatter and rename artifacts
working-directory: msi
run: find -name '*.msi' -printf "%p\n" | while read f; do mv $f $(dirname $f).msi; rm -rf $(dirname $f); done
- name: Knock ports on remote
run: knock -d 500 ${{ secrets.MSI_UPLOAD_REMOTE_HOST }} ${{ secrets.MSI_UPLOAD_REMOTE_KNOCK_SEQUENCE }} ; sleep 1
- name: Copy MSI to remote
uses: garygrossgarten/github-action-scp@release
with:
local: msi
remote: ${{ secrets.MSI_UPLOAD_REMOTE_PATH }}
host: ${{ secrets.MSI_UPLOAD_REMOTE_HOST }}
port: ${{ secrets.MSI_UPLOAD_REMOTE_PORT }}
username: ${{ secrets.MSI_UPLOAD_USERNAME }}
privateKey: ${{ secrets.MSI_UPLOAD_PRIVATE_KEY }}
passphrase: ${{ secrets.MSI_UPLOAD_KEY_PASSPHRASE }}