Build Executables #4
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-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 | |
mv dist/commitify ./commitify-linux | |
- name: Upload Linux artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: linux-executable | |
path: commitify-linux | |
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 | |
move dist\commitify.exe commitify.exe # Just rename to commitify.exe | |
- name: Upload Windows artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: windows-executable | |
path: commitify.exe # Just the binary without any suffix | |
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 | |
mv dist/commitify ./commitify # No suffix for macOS | |
- name: Upload macOS artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: macos-executable | |
path: commitify # Just the binary without any suffix | |
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 | |
uses: actions/checkout@v3 | |
- name: Upload Release Assets | |
uses: softprops/action-gh-release@v1 # GitHub Action to create a release. | |
with: | |
tag_name: ${{ github.event.release.tag_name }} | |
files: commitify-linux, commitify.exe, commitify # Correctly formatted as a string. | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |