ci: add release workflow for Windows, macOS, and Linux binaries
- Build standalone executables with PyInstaller - Auto-create GitHub release on version tag push - Release includes binaries for all platforms
This commit is contained in:
82
.github/workflows/release.yml
vendored
Normal file
82
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
name: Build & Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "v*"
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build ${{ matrix.os }}
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||||
|
include:
|
||||||
|
- os: ubuntu-latest
|
||||||
|
artifact_name: genpass-linux
|
||||||
|
asset_name: genpass-linux
|
||||||
|
- os: windows-latest
|
||||||
|
artifact_name: genpass-windows.exe
|
||||||
|
asset_name: genpass-windows.exe
|
||||||
|
- os: macos-latest
|
||||||
|
artifact_name: genpass-macos
|
||||||
|
asset_name: genpass-macos
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: "3.12"
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install pyinstaller
|
||||||
|
pip install -e .
|
||||||
|
|
||||||
|
- name: Build executable with PyInstaller
|
||||||
|
run: |
|
||||||
|
pyinstaller --onefile --name ${{ matrix.artifact_name }} genpass/cli.py
|
||||||
|
|
||||||
|
- name: Upload artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.artifact_name }}
|
||||||
|
path: dist/${{ matrix.artifact_name }}${{ matrix.os == 'windows-latest' && '.exe' || '' }}
|
||||||
|
|
||||||
|
release:
|
||||||
|
name: Create Release
|
||||||
|
needs: build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Download all artifacts
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
path: artifacts
|
||||||
|
|
||||||
|
- name: Prepare release assets
|
||||||
|
run: |
|
||||||
|
cd artifacts
|
||||||
|
ls -R
|
||||||
|
mv genpass-linux/genpass-linux genpass-linux
|
||||||
|
mv genpass-windows.exe/genpass-windows.exe genpass-windows.exe
|
||||||
|
mv genpass-macos/genpass-macos genpass-macos
|
||||||
|
|
||||||
|
- name: Create Release
|
||||||
|
uses: softprops/action-gh-release@v1
|
||||||
|
with:
|
||||||
|
files: |
|
||||||
|
artifacts/genpass-linux
|
||||||
|
artifacts/genpass-windows.exe
|
||||||
|
artifacts/genpass-macos
|
||||||
|
generate_release_notes: true
|
||||||
|
draft: true
|
||||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -27,10 +27,10 @@ share/python-wheels/
|
|||||||
MANIFEST
|
MANIFEST
|
||||||
|
|
||||||
# PyInstaller
|
# PyInstaller
|
||||||
# Usually these files are written by a python script from a template
|
|
||||||
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
||||||
*.manifest
|
*.manifest
|
||||||
*.spec
|
*.spec
|
||||||
|
dist/
|
||||||
|
build/
|
||||||
|
|
||||||
# Installer logs
|
# Installer logs
|
||||||
pip-log.txt
|
pip-log.txt
|
||||||
|
|||||||
Reference in New Issue
Block a user