Skip to content

ci: attempt to add release creation #3

ci: attempt to add release creation

ci: attempt to add release creation #3

name: Build Executables
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12" # Your Python version
- name: Install pipenv
run: pip install pipenv
- name: Install dependencies
run: pipenv install --dev
- name: Install PyInstaller
run: pipenv run pip install pyinstaller
- name: Build executable for ${{ matrix.os }}
shell: bash
run: |
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
pipenv run pyinstaller --onefile --name weduc_timetable_extractor_windows weduc_timetable_extractor/__main__.py
elif [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then
pipenv run pyinstaller --onefile --name weduc_timetable_extractor_linux weduc_timetable_extractor/__main__.py
elif [[ "${{ matrix.os }}" == "macos-latest" ]]; then
pipenv run pyinstaller --onefile --name weduc_timetable_extractor_macos weduc_timetable_extractor/__main__.py
fi
# Step 5: Create a release using the GitHub CLI (gh)
- name: Create GitHub Release
shell: bash
run: |
gh release create ${{ github.ref }} \
./dist/weduc_timetable_extractor* \
--title "Release ${{ github.ref }}" \
--notes "Automatically generated release for ${{ github.ref }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Step 6: Upload the generated assets (if there are multiple, include them all)
- name: Upload release assets
run: |
gh release upload ${{ github.ref }} ./dist/weduc_timetable_extractor*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}