-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add pixi workflow, github CI yml, python script to create pyinstaller…
… zip
- Loading branch information
Showing
3 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
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
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) |
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
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 |
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