feat: Update subnet mask detection for Linux/macOS #82
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
build-windows: | |
name: Build Windows | |
runs-on: windows-latest | |
steps: | |
- name: π§Ύ Checkout code | |
uses: actions/checkout@v3 | |
- name: π Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: π¦ Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install nuitka | |
pip install -r requirements.txt | |
- name: π₯ Pre-install Dependency Walker | |
shell: powershell | |
run: | | |
$dependsUrl = "https://dependencywalker.com/depends22_x64.zip" | |
$zipPath = "$env:TEMP\depends.zip" | |
$extractPath = "$env:LOCALAPPDATA\Nuitka\Nuitka\Cache\downloads\depends\x86_64" | |
Invoke-WebRequest -Uri $dependsUrl -OutFile $zipPath | |
Expand-Archive -Path $zipPath -DestinationPath $extractPath -Force | |
Write-Host "β Dependency Walker installed at $extractPath" | |
- name: π¨ Build executable with Nuitka | |
shell: powershell | |
run: | | |
nuitka main.py ` | |
--standalone ` | |
--onefile ` | |
--enable-plugin=tk-inter ` | |
--include-data-dir=data=data ` | |
--windows-console-mode=disable ` | |
--output-filename=hello_ips.exe | |
- name: π Calculate SHA-256 Hash (Windows) | |
shell: powershell | |
run: | | |
$hash = Get-FileHash hello_ips.exe -Algorithm SHA256 | |
$hash.Hash | Out-File -FilePath sha256sum_windows.txt -Encoding ascii | |
Get-Content sha256sum_windows.txt | |
- name: π€ Upload Windows artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: windows-artifacts | |
path: | | |
hello_ips.exe | |
sha256sum_windows.txt | |
create-release: | |
name: Create Release | |
needs: [build-windows] | |
if: ${{ github.event_name == 'push' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: π₯ Download all artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: artifacts | |
- name: ποΈ Delete existing release and tag (if any) | |
continue-on-error: true | |
run: | | |
gh release delete build -y || echo "No release to delete" | |
git push --delete origin build || echo "No tag to delete" | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: π Prepare release notes | |
run: | | |
echo "Windows SHA-256:" > release_notes.txt | |
cat artifacts/windows-artifacts/sha256sum_windows.txt >> release_notes.txt | |
- name: π Create Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: build | |
name: build | |
body_path: release_notes.txt | |
draft: false | |
prerelease: false | |
files: | | |
artifacts/windows-artifacts/hello_ips.exe | |
artifacts/windows-artifacts/sha256sum_windows.txt | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |