Skip to content

Commit

Permalink
build: fix release
Browse files Browse the repository at this point in the history
  • Loading branch information
truenicoco committed Jan 6, 2025
1 parent 9ab2b17 commit 6f7d438
Showing 1 changed file with 24 additions and 20 deletions.
44 changes: 24 additions & 20 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Extract version from tag or commit SHA
- name: Set version from tag or commit SHA
id: version
run: |
case ${{ github.ref }} in
Expand All @@ -18,41 +18,45 @@ jobs:
id=0.0.0dev+git$(date +%Y%m%d-%H%M)-$(echo ${{ github.sha }} | cut -c1-8)
;;
esac
echo "::set-output name=id::$id"
- name: Set version in appropriate files
run: |
sed -i 's/NO_VERSION/${{steps.version.outputs.id}}/' hh_creator/__init__.py
sed -i 's/0.0.0dev/${{steps.version.outputs.id}}/' pyproject.toml
echo "HH_CREATOR_VERSION=$id" >> $GITHUB_ENV
sed -i 's/NO_VERSION/$HH_CREATOR_VERSION/' hh_creator/__init__.py
sed -i 's/0.0.0dev/$HH_CREATOR_VERSION/' pyproject.toml
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: export requirements
run: uv pip compile pyproject.toml -o pyinstaller/requirements.txt

- name: Export requirements for pyinstaller
run: uv pip compile pyproject.toml -o pyinstaller/requirements.txt
- name: PyInstaller Windows
uses: ./.github/actions/pyinstaller
with:
path: pyinstaller

- name: Build PyPI package
run: uv build

- uses: actions/upload-artifact@v4
with:
name: hh-creator
name: hh-creator-${{ github.ref_name }}-windows.zip
path: pyinstaller/dist/windows
- uses: actions/upload-artifact@v4
with:
name: hh-creator-${{ github.ref_name }}-pypi.zip
path: dist

release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Zip for release
- name: PyPI release
if: startsWith(github.ref, 'refs/tags/v')
run: uv publish

- name: Zip for github release
if: startsWith(github.ref, 'refs/tags/v')
uses: montudor/action-zip@v1
with:
args: 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
- name: PyPI release
run: |
uv build
uv publish
files:
hh-creator-${{ github.ref_name }}-windows.zip
dist/*

0 comments on commit 6f7d438

Please sign in to comment.