Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 13 additions & 20 deletions .github/workflows/build_exe.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: Build Executables

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+-?*"
workflow_dispatch:
workflow_call:
inputs:
is_release:
required: true
type: boolean

jobs:
build:
Expand All @@ -18,18 +19,21 @@ jobs:
move_command: move dist\mangotango.exe dist\mangotango_windows.exe
sha_command: pwsh -c "Get-FileHash -Algorithm SHA1 dist\mangotango_windows.exe | Format-Table Hash -HideTableHeaders > dist\mangotango_windows.exe.sha1"
list_command: dir dist
check_command: dist\mangotango_windows.exe --noop
- platform_name: MacOS 14
artifact_name: macos-14
os: macos-14
move_command: mv dist/mangotango dist/mangotango_macos_14
sha_command: shasum -a 1 dist/mangotango_macos_14 > dist/mangotango_macos_14.sha1
list_command: ls -ll dist
check_command: dist/mangotango_macos_14 --noop
- platform_name: MacOS 15
artifact_name: macos-15
os: macos-15
move_command: mv dist/mangotango dist/mangotango_macos_15
sha_command: shasum -a 1 dist/mangotango_macos_15 > dist/mangotango_macos_15.sha1
list_command: ls -ll dist
check_command: dist/mangotango_macos_15 --noop

name: Build ${{ matrix.platform_name }}
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -88,26 +92,15 @@ jobs:
- name: Inspect the dist/ directory before uploading artifacts
run: ${{ matrix.list_command }}

- name: Check that the executable runs
if: inputs.is_release == false
run: ${{ matrix.check_command}}

- name: Upload artifacts
if: inputs.is_release
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: |
dist/*

release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts

- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: |
artifacts/**/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29 changes: 29 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: New Release

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+-?*"
workflow_dispatch:

jobs:
call-build_exe:
uses: ./.github/workflows/build_exe.yml
with:
is_release: true
release:
needs: call-build_exe
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts

- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: |
artifacts/**/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ jobs:

- name: Run tests
run: pytest
test_build:
uses: ./.github/workflows/build_exe.yml
with:
is_release: false
4 changes: 4 additions & 0 deletions mangotango.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
from multiprocessing import freeze_support

from analyzers import suite
Expand All @@ -11,6 +12,9 @@
freeze_support()
enable_windows_ansi_support()
storage = Storage(app_name="MangoTango", app_author="Civic Tech DC")
if "--noop" in sys.argv or "/noop" in sys.argv:
print("No-op flag detected. Exiting successfully.")
sys.exit(0)

splash()
main_menu(
Expand Down