Skip to content

Commit

Permalink
Publish releases
Browse files Browse the repository at this point in the history
  • Loading branch information
crabhi committed Mar 7, 2023
1 parent f70823d commit 58fca3e
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/pyinstaller.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: PyInstaller

on:
push:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout project sources
uses: actions/checkout@v2

- name: Run release build
run: docker run --rm -i -v "$(pwd)":/app python:3.11-buster /app/build_release.sh ${{ github.ref_name }}

- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: dist/*.tgz
Empty file added build.sh
Empty file.
16 changes: 16 additions & 0 deletions build_release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

set -ex

TAG="${1:-SNAPSHOT}"

set -u

cd "$(dirname "$0")"

pip3 install pyinstaller
pip3 install -e .

pyinstaller pve.spec

(cd dist/ && tar -czf pve_exporter-"$TAG"-linux-i686.tgz pve_exporter/)
7 changes: 7 additions & 0 deletions pve.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"""
Entrypoint similar to what setup.py defines - but digestible for pyinstaller.
"""
from pve_exporter.cli import main

if __name__ == '__main__':
main()
50 changes: 50 additions & 0 deletions pve.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# -*- mode: python ; coding: utf-8 -*-


block_cipher = None


a = Analysis(
['pve.py'],
pathex=[],
binaries=[],
datas=[],
hiddenimports=['gunicorn.glogging', 'gunicorn.workers.gthread', 'proxmoxer.backends.https'],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)

exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name='pve_exporter',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=True,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name='pve_exporter',
)

0 comments on commit 58fca3e

Please sign in to comment.