Skip to content

Commit

Permalink
Add pixi workflow, github CI yml, python script to create pyinstaller…
Browse files Browse the repository at this point in the history
… zip
  • Loading branch information
Huite committed Dec 17, 2023
1 parent 9ab6773 commit 5ace0ef
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/create_archive.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from pathlib import Path
import hashlib
import platform
import shutil

# Create archive
shutil.make_archive("dist/gistim", "zip", "dist/gistim")

# Create a checksum
path = Path("dist/gistim.zip")
with open(path, "rb", buffering=0) as f:
sha256_hash = hashlib.file_digest(f, "sha256").hexdigest()

# Include it in the filename.
filename = f"dist/gistim-{platform.system()}-{sha256_hash}.zip"
path.rename(filename)
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: release

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ${{ matrix.os }}
matrix:
os:
- ubuntu-latest
- macOS-latest
- windows-latest
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Setup Pixi
uses: prefix-dev/setup-pixi@v0.4.1
- name: Build with PyInstaller
run: pixi run build-backend
- name: Create ZIP Archive
run: pixi run create-archive
- name: Upload archive
uses: softprops/action-gh-release@v1
with:
files: *.zip
1 change: 1 addition & 0 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ repository = "https://github.com/Deltares/qgis-tim"
[tasks]
install = "pip install --no-deps --editable ."
build-backend = "pyinstaller gistim/__main__.py --name gistim"
create-archive = "python .github/workflows/create_archive.py"

[dependencies]
python = "3.11"
Expand Down

0 comments on commit 5ace0ef

Please sign in to comment.