-
Notifications
You must be signed in to change notification settings - Fork 42
69 lines (56 loc) · 2.02 KB
/
publish_package.yml
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
name: Publish and Update Formula
on:
release:
types: [ created ]
jobs:
build-n-publish:
name: Build and publish Python distributions to PyPI
runs-on: ubuntu-latest
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install build and tomlkit dependencies
run: python -m pip install --upgrade pip build tomlkit
- name: Extract version from tag
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Update version in pyproject.toml
run: |
sed -i "s/version = \".*\"/version = \"${{ env.VERSION }}\"/" pyproject.toml
- name: Build distribution
run: python -m build --sdist --wheel --outdir dist/
- name: Publish distribution to PyPI
uses: pypa/[email protected]
update-homebrew-formula:
needs: build-n-publish
runs-on: ubuntu-latest
steps:
- name: Checkout Homebrew repo
uses: actions/checkout@v3
with:
repository: Comfy-Org/homebrew-comfy-cli
path: homebrew-comfy-cli
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Create virtual environment and update formula
run: |
python3 -m venv venv
source venv/bin/activate
pip install comfy-cli homebrew-pypi-poet
mkdir -p homebrew-comfy-cli/Formula
poet -f comfy-cli > homebrew-comfy-cli/Formula/comfy-cli.rb
- name: Commit and push changes
run: |
cd homebrew-comfy-cli
git config --global user.name 'GitHub Actions'
git config --global user.email '[email protected]'
git add Formula/comfy-cli.rb
git commit -m "Update comfy-cli formula"
git push