Skip to content

build: fix release

build: fix release #9

Workflow file for this run

name: Package Application
on: push
jobs:
build:
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: astral-sh/setup-uv@v4
- uses: actions/checkout@v4
- name: Set version from tag or commit SHA
run: |
case ${{ github.ref }} in
"refs/tags/v*")
VERSION=$(echo ${{ github.ref_name }} | cut -c2-)
;;
*)
VERSION=0.0.0dev+git$(date +%Y%m%d-%H%M)-$(echo ${{ github.sha }} | cut -c1-8)
;;
esac
sed -i "s/NO_VERSION/$VERSION/" hh_creator/__init__.py
sed -i "s/0.0.0dev/$VERSION/" pyproject.toml
# pyinstaller for windows
- name: Export requirements for pyinstaller
run: uv pip compile pyproject.toml -o pyinstaller/requirements.txt
- uses: ./.github/actions/pyinstaller
with:
path: pyinstaller
- uses: actions/upload-artifact@v4
with:
name: hh-creator-${{ github.ref_name }}-windows.zip
path: pyinstaller/dist/windows
# python package
- name: Build PyPI package
run: uv build
- uses: actions/upload-artifact@v4
with:
name: hh-creator-${{ github.ref_name }}-pypi.zip
path: dist
- name: PyPI release
if: startsWith(github.ref, 'refs/tags/v')
run: uv publish
# github release
- name: Zip for github release
if: startsWith(github.ref, 'refs/tags/v')
run: zip -qq -r hh-creator-${{ github.ref_name }}-windows.zip pyinstaller/dist/windows
- name: Github release
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
files:
hh-creator-${{ github.ref_name }}-windows.zip
dist/*