1.0.4 #11
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] | |
permissions: write-all | |
jobs: | |
build-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: Install PyInstaller | |
run: pip install pyinstaller | |
- name: Build executable for Linux | |
run: | | |
pyinstaller --onefile commitify.py | |
- name: Move Linux executable | |
run: | | |
mv dist/commitify ./commitify-linux | |
- name: List files after build (Linux) | |
run: | | |
ls -al | |
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.9' | |
- name: Install PyInstaller | |
run: pip install pyinstaller | |
- name: Build executable for Windows | |
run: | | |
pyinstaller --onefile commitify.py | |
- name: Move Windows executable | |
run: | | |
move dist\commitify.exe commitify.exe # Just rename to commitify.exe | |
- name: List files after build (Windows) | |
run: | | |
dir | |
build-macos: | |
runs-on: macos-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: Install PyInstaller | |
run: pip install pyinstaller | |
- name: Build executable for macOS | |
run: | | |
pyinstaller --onefile commitify.py | |
- name: Move macOS executable | |
run: | | |
mv dist/commitify ./commitify # No suffix for macOS | |
- name: List files after build (macOS) | |
run: | | |
ls -al | |
release: | |
needs: [build-linux, build-windows, build-macos] | |
runs-on: ubuntu-latest # This can be any OS since we are just uploading artifacts. | |
steps: | |
- name: Checkout code for release job | |
uses: actions/checkout@v3 | |
# Install GitHub CLI | |
- name: Install GitHub CLI | |
run: sudo apt-get install gh # For Ubuntu; adjust for other OS if needed. | |
# Authenticate with GITHUB_TOKEN | |
- name: Authenticate with GitHub CLI | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: gh auth login --with-token <<< "$GITHUB_TOKEN" | |
# Upload Release Assets using GitHub CLI | |
- name: Upload Release Assets | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release upload ${{ github.event.release.tag_name }} \ | |
commitify-linux \ | |
commitify.exe \ | |
commitify \ | |
--clobber # Use --clobber to overwrite existing files if necessary. |