Build Executables #7
Workflow file for this run
This file contains 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 Executables | |
on: | |
release: | |
types: [published] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
permissions: | |
contents: write | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
include: | |
- os: ubuntu-latest | |
dist_name: linux | |
- os: windows-latest | |
dist_name: windows | |
- os: macos-latest | |
dist_name: mac | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.12 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pyinstaller openpyxl tabulate | |
- name: Build executable | |
run: | | |
mkdir -p ${{ matrix.dist_name }} | |
pyinstaller --onefile aggie_unterprise/aggie_report.py --distpath ${{ matrix.dist_name }} | |
- name: List directory contents (for debugging) | |
shell: bash | |
run: | | |
if [ "${{ runner.os }}" == "Windows" ]; then | |
Get-ChildItem -Recurse ${{ matrix.dist_name }} | |
else | |
ls -lR ${{ matrix.dist_name }} | |
fi | |
- name: Rename executable | |
shell: bash | |
run: | | |
if [ "${{ runner.os }}" == "Windows" ]; then | |
mv ${{ matrix.dist_name }}/aggie_report.exe ${{ matrix.dist_name }}/aggie-report.exe | |
else | |
mv ${{ matrix.dist_name }}/aggie_report ${{ matrix.dist_name }}/aggie-report | |
fi | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ${{ matrix.dist_name }}/aggie-report${{ runner.os == 'Windows' && '.exe' || '' }} | |
asset_name: aggie-report-${{ matrix.dist_name }}${{ runner.os == 'Windows' && '.exe' || '' }} | |
asset_content_type: application/octet-stream | |
- name: Upload Artifact (for debugging) | |
uses: actions/upload-artifact@v2 | |
with: | |
name: aggie-report-${{ matrix.dist_name }} | |
path: ${{ matrix.dist_name }} | |
- name: Debug Info | |
if: failure() | |
shell: bash | |
run: | | |
echo "Current directory:" | |
pwd | |
echo "Directory contents:" | |
if [ "${{ runner.os }}" == "Windows" ]; then | |
Get-ChildItem -Recurse | |
else | |
ls -lR | |
fi | |
echo "Environment variables:" | |
env |