forked from robertdavidgraham/masscan
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (55 loc) · 1.87 KB
/
Copy pathbuild-windows.yml
File metadata and controls
64 lines (55 loc) · 1.87 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
name: Build and Release masscan for Windows (x64)
on:
push:
branches: [ master ]
tags:
- 'v*' # triggers a release on tags like v1.0.0
workflow_dispatch: # manual trigger from the Actions tab
jobs:
build-and-release:
runs-on: windows-latest
steps:
# 1. Checkout your source code
- name: Checkout code
uses: actions/checkout@v4
# 2. Download and extract the Npcap SDK (WinPcap-compatible)
- name: Setup Npcap SDK
run: |
curl -L -o npcap-sdk.zip https://npcap.com/dist/npcap-sdk-1.13.zip
mkdir npcap-sdk
tar -xf npcap-sdk.zip -C npcap-sdk
echo "PCAP_DIR=$env:GITHUB_WORKSPACE\npcap-sdk" >> $env:GITHUB_ENV
shell: pwsh
# 3. Configure MSVC x64 environment
- name: Setup MSVC Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
# 4. Build masscan.exe using the provided Makefile.msvc
- name: Build masscan
run: |
nmake -f Makefile.msvc
shell: cmd
# 5. Verify the executable was created
- name: Check binary
run: |
if not exist "bin\masscan.exe" exit /b 1
shell: cmd
# 6. Upload the exe as an artifact (useful for testing on every push)
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: masscan-win64
path: bin\masscan.exe
# 7. Create a GitHub Release and attach the exe (only on tag pushes)
- name: Create Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: bin\masscan.exe
name: ${{ github.ref_name }}
body: |
Automated masscan Windows 64-bit build.
Commit: ${{ github.sha }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}