-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (55 loc) · 1.81 KB
/
build.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Package Application
on: push
jobs:
build:
runs-on: ubuntu-latest
permissions:
id-token: write # for the PyPI release
contents: write # for the GH release
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
echo Package will be versioned as $VERSION
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/*