Skip to content

feat: Update subnet mask detection for Linux/macOS #82

feat: Update subnet mask detection for Linux/macOS

feat: Update subnet mask detection for Linux/macOS #82

Workflow file for this run

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 }}