-
Notifications
You must be signed in to change notification settings - Fork 17
113 lines (95 loc) · 3.72 KB
/
Copy pathci-windows.yml
File metadata and controls
113 lines (95 loc) · 3.72 KB
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
name: ci - windows binary build
on:
workflow_call:
outputs:
release_tags:
value: ${{ jobs.build.outputs.release_tags }}
inputs:
source_repo:
type: string
required: true
source_branch:
type: string
required: true
artifacts_only:
type: string
required: true
secrets:
VT_API_KEY:
required: false
env:
GH_TOKEN: "${{ github.TOKEN }}"
jobs:
build:
runs-on: windows-latest
environment: production
outputs:
release_tags: ${{ steps.release_tags.outputs.release_tag }}
strategy:
fail-fast: false
matrix:
name: [iperf3]
build: [basic, openssl]
arch: [amd64]
include:
- build: "basic"
filename: ""
openssl: "no"
- build: "openssl"
filename: "-openssl"
openssl: "yes"
name: ${{ matrix.name }}-${{ matrix.arch }}-win${{ matrix.filename }}.zip
env:
cygwin_path: "cygwin"
source_branch: ${{ inputs.source_branch }}
source_repo: ${{ inputs.source_repo }}
steps:
- run: git config --global core.autocrlf input
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install ci-cygwin-installer.cmd
run: .\ci-cygwin-installer.cmd
- name: Build static
run: .\cygwin\bin\bash.exe -l ci-windows-cygwin-build.sh "${{ matrix.openssl }}" "$env:cygwin_path" "$env:source_repo" "$env:source_branch"
- name: VirusTotal Scan
id: virustotal
uses: crazy-max/ghaction-virustotal@936d8c5c00afe97d3d9a1af26d017cfdf26800a2 # v5.0.0
with:
vt_api_key: ${{ secrets.VT_API_KEY }}
files: |
${{ matrix.name }}/bin/iperf3.exe
${{ matrix.name }}/bin/cygwin1.dll
- name: sha256sum
run: |
printf '%s' https://www.virustotal.com/gui/file/$(sha256sum ${{ matrix.name }}/bin/iperf3.exe | awk '{print $1}') > ${{ matrix.name }}-${{ matrix.arch }}-win${{ matrix.filename }}.url
cat ${{ matrix.name }}-${{ matrix.arch }}-win${{ matrix.filename }}.url
- name: Archive build
run: Compress-Archive -Path "${{ matrix.name }}/bin/*" -DestinationPath "${{ matrix.name }}-${{ matrix.arch }}-win${{ matrix.filename }}.zip"
- name: Generate artifact attestation
uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2
with:
subject-path: |
${{ matrix.name }}-${{ matrix.arch }}-win${{ matrix.filename }}.zip
${{ matrix.name }}/bin/iperf3.exe
${{ matrix.name }}/bin/cygwin1.dll
- name: Create tag env
run: printf '%s\n' "release_tag=$(Get-Content -Path iperf3_version)" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
- name: Set tag env to output
id: release_tags
run: printf '%s\n' "release_tag=${release_tag}" >> $env:GITHUB_OUTPUT
- name: "Release - Create artifacts"
if: inputs.artifacts_only == 'false'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: "${{ matrix.name }}-amd64-win${{ matrix.filename }}"
path: |
${{ matrix.name }}-${{ matrix.arch }}-win${{ matrix.filename }}.zip
${{ matrix.name }}-${{ matrix.arch }}-win${{ matrix.filename }}.url
- name: "Dev - Create artifacts"
if: inputs.artifacts_only == 'true'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: "${{ matrix.name }}-amd64-win${{ matrix.filename }}"
path: "${{ matrix.name }}"