-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (68 loc) · 2.2 KB
/
Copy pathpypi-publish.yml
File metadata and controls
75 lines (68 loc) · 2.2 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
name: Unified Release Pipeline
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
tag_name:
description: 'Tag name (e.g. v0.1.1)'
required: true
jobs:
publish-pypi:
name: Build and publish to PyPI
runs-on: ubuntu-latest
environment:
name: release
url: https://pypi.org/p/devin-cli
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build binary wheel and source tarball
run: python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
update-homebrew:
name: Update Homebrew Formula
needs: publish-pypi
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Resolve version and URL
run: |
VERSION=${GITHUB_REF_NAME#v}
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
VERSION="${{ github.event.inputs.tag_name }}"
VERSION=${VERSION#v}
fi
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "URL=https://files.pythonhosted.org/packages/source/d/devin-cli/devin_cli-${VERSION}.tar.gz" >> $GITHUB_ENV
- name: Wait for PyPI CDN propagation
run: |
echo "Waiting 90 seconds for PyPI CDN to propagate..."
sleep 90
echo "Verifying tarball is accessible..."
curl --fail --silent --head "$URL" && echo "Tarball is available." || (echo "ERROR: Tarball not yet available at $URL" && exit 1)
env:
URL: ${{ env.URL }}
- name: Update Homebrew Formula
uses: mislav/bump-homebrew-formula-action@v3
with:
formula-name: devin-cli
homebrew-tap: revanthpobala/homebrew-tap
base-branch: main
download-url: ${{ env.URL }}
commit-message: "Update devin-cli to ${{ env.VERSION }}"
env:
COMMITTER_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}