-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (82 loc) · 2.58 KB
/
release.yml
File metadata and controls
87 lines (82 loc) · 2.58 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
pypi:
name: Publish to PyPI
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Build package
run: |
pip install build
python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
binary:
name: Build macOS binary
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
pip install -e ".[vision]"
pip install pyinstaller
- name: Build binary
run: |
pyinstaller \
--name video2ai \
--onefile \
--hidden-import video2ai \
--hidden-import video2ai.cli \
--hidden-import video2ai.web \
--hidden-import video2ai.frames \
--hidden-import video2ai.probe \
--hidden-import video2ai.transcribe \
--hidden-import video2ai.vision \
--hidden-import video2ai.clip_match \
--hidden-import video2ai.contact_sheet \
--hidden-import video2ai.embed \
--hidden-import video2ai.llm \
--hidden-import video2ai.output \
--collect-data whisper \
video2ai/cli.py
- name: Upload binary to release
uses: softprops/action-gh-release@v2
with:
files: dist/video2ai
update-homebrew:
name: Update Homebrew formula
runs-on: ubuntu-latest
needs: [pypi]
steps:
- uses: actions/checkout@v4
- name: Update formula SHA
env:
TAG_NAME: ${{ github.ref_name }}
run: |
SHA=$(curl -sL "https://github.com/sameeeeeeep/video2ai/archive/refs/tags/${TAG_NAME}.tar.gz" | shasum -a 256 | cut -d' ' -f1)
sed -i "s|sha256 \".*\"|sha256 \"${SHA}\"|" Formula/video2ai.rb
sed -i "s|/v[0-9.]*\.tar\.gz|/${TAG_NAME}.tar.gz|" Formula/video2ai.rb
- name: Commit updated formula
env:
TAG_NAME: ${{ github.ref_name }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add Formula/video2ai.rb
git diff --cached --quiet || git commit -m "brew: update formula for ${TAG_NAME}"
git push origin HEAD:main