diff --git a/.github/workflows/build_exe.yml b/.github/workflows/build_exe.yml index 7e6e85af..949c9ccb 100644 --- a/.github/workflows/build_exe.yml +++ b/.github/workflows/build_exe.yml @@ -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: @@ -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 }} @@ -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 }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..9b23c1cb --- /dev/null +++ b/.github/workflows/release.yml @@ -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 }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7bc9a240..ecc94986 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,3 +29,7 @@ jobs: - name: Run tests run: pytest + test_build: + uses: ./.github/workflows/build_exe.yml + with: + is_release: false diff --git a/mangotango.py b/mangotango.py index b0dc5198..300dedc6 100644 --- a/mangotango.py +++ b/mangotango.py @@ -1,3 +1,4 @@ +import sys from multiprocessing import freeze_support from analyzers import suite @@ -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(