Skip to content

Release

Release #73

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
# Manual escape hatch: when a tag was pushed by a bot/PAT and GitHub
# therefore did not fire the push trigger automatically, an admin can
# re-run the publish pipeline against an existing tag with:
# gh workflow run release.yml --ref v<X.Y.Z> --repo DailybotHQ/cli
# The workflow uses ${{ github.ref_name }} for the version, which resolves
# to the tag name when the workflow is dispatched on a tag ref.
workflow_dispatch: {}
permissions:
contents: write
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
# Build Linux binary (only platform where unsigned binaries work well)
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Build binary in container with glibc 2.31
run: |
docker run --rm -v "$PWD":/src -w /src python:3.12-slim-bullseye sh -c '
apt-get update && apt-get install -y binutils
pip install pyinstaller
pip install -e .
pyinstaller --onefile --name dailybot --clean dailybot_cli/main.py
'
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: dailybot-linux-x86_64
path: dist/dailybot
# Publish to PyPI
publish-pypi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Build package
run: |
pip install build twine
python -m build
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
twine upload dist/*
# Create GitHub Release with Linux binary
release:
needs: [build-linux, publish-pypi]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: dailybot-linux-x86_64
path: artifacts
- name: Rename binary
run: mv artifacts/dailybot artifacts/dailybot-linux-x86_64
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: artifacts/*
# Update Homebrew tap
update-homebrew:
needs: publish-pypi
runs-on: ubuntu-latest
steps:
- name: Get version from tag
id: version
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
- name: Wait for PyPI propagation
run: |
VERSION="${{ steps.version.outputs.version }}"
for i in 1 2 3 4 5 6; do
if pip download dailybot-cli==$VERSION --no-binary :all: --no-deps -d /tmp/sdist 2>/dev/null; then
echo "Package available on PyPI"
exit 0
fi
echo "Attempt $i: package not yet available, waiting 30s..."
sleep 30
done
echo "::error::Package dailybot-cli==$VERSION not found on PyPI after 3 minutes"
exit 1
- name: Get sdist sha256
id: sha
run: |
SHA=$(sha256sum /tmp/sdist/dailybot_cli-${{ steps.version.outputs.version }}.tar.gz | cut -d' ' -f1)
echo "sha256=$SHA" >> "$GITHUB_OUTPUT"
- name: Checkout homebrew-tap
uses: actions/checkout@v6
with:
repository: DailyBotHQ/homebrew-tap
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
path: homebrew-tap
- name: Update formula
env:
PKG_VERSION: ${{ steps.version.outputs.version }}
PKG_SHA256: ${{ steps.sha.outputs.sha256 }}
run: |
python3 -c "
import os, textwrap
v = os.environ['PKG_VERSION']
s = os.environ['PKG_SHA256']
formula = textwrap.dedent('''
class Dailybot < Formula
include Language::Python::Virtualenv
desc \"The command-line bridge between humans and agents\"
homepage \"https://www.dailybot.com\"
url \"https://files.pythonhosted.org/packages/source/d/dailybot-cli/dailybot_cli-{version}.tar.gz\"
sha256 \"{sha256}\"
license \"MIT\"
depends_on \"python@3.12\"
resource \"click\" do
url \"https://files.pythonhosted.org/packages/source/c/click/click-8.3.3.tar.gz\"
sha256 \"398329ad4837b2ff7cbe1dd166a4c0f8900c3ca3a218de04466f38f6497f18a2\"
end
resource \"httpx\" do
url \"https://files.pythonhosted.org/packages/source/h/httpx/httpx-0.28.1.tar.gz\"
sha256 \"75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc\"
end
resource \"httpcore\" do
url \"https://files.pythonhosted.org/packages/source/h/httpcore/httpcore-1.0.9.tar.gz\"
sha256 \"6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8\"
end
resource \"anyio\" do
url \"https://files.pythonhosted.org/packages/source/a/anyio/anyio-4.13.0.tar.gz\"
sha256 \"334b70e641fd2221c1505b3890c69882fe4a2df910cba14d97019b90b24439dc\"
end
resource \"certifi\" do
url \"https://files.pythonhosted.org/packages/source/c/certifi/certifi-2026.4.22.tar.gz\"
sha256 \"8d455352a37b71bf76a79caa83a3d6c25afee4a385d632127b6afb3963f1c580\"
end
resource \"idna\" do
url \"https://files.pythonhosted.org/packages/source/i/idna/idna-3.13.tar.gz\"
sha256 \"585ea8fe5d69b9181ec1afba340451fba6ba764af97026f92a91d4eef164a242\"
end
resource \"h11\" do
url \"https://files.pythonhosted.org/packages/source/h/h11/h11-0.16.0.tar.gz\"
sha256 \"4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1\"
end
resource \"questionary\" do
url \"https://files.pythonhosted.org/packages/source/q/questionary/questionary-2.1.1.tar.gz\"
sha256 \"3d7e980292bb0107abaa79c68dd3eee3c561b83a0f89ae482860b181c8bd412d\"
end
resource \"prompt-toolkit\" do
url \"https://files.pythonhosted.org/packages/source/p/prompt_toolkit/prompt_toolkit-3.0.52.tar.gz\"
sha256 \"28cde192929c8e7321de85de1ddbe736f1375148b02f2e17edd840042b1be855\"
end
resource \"wcwidth\" do
url \"https://files.pythonhosted.org/packages/source/w/wcwidth/wcwidth-0.6.0.tar.gz\"
sha256 \"cdc4e4262d6ef9a1a57e018384cbeb1208d8abbc64176027e2c2455c81313159\"
end
resource \"rich\" do
url \"https://files.pythonhosted.org/packages/source/r/rich/rich-15.0.0.tar.gz\"
sha256 \"edd07a4824c6b40189fb7ac9bc4c52536e9780fbbfbddf6f1e2502c31b068c36\"
end
resource \"textual\" do
url \"https://files.pythonhosted.org/packages/source/t/textual/textual-8.2.7.tar.gz\"
sha256 \"658f568ff81e30ed43890c3e07520390e5cf1b4763822006e060656b0a88f105\"
end
resource \"platformdirs\" do
url \"https://files.pythonhosted.org/packages/source/p/platformdirs/platformdirs-4.10.0.tar.gz\"
sha256 \"31e761a6a0ca04faf7353ea759bdba55652be214725111e5aac52dfa29d4bef7\"
end
resource \"markdown-it-py\" do
url \"https://files.pythonhosted.org/packages/source/m/markdown_it_py/markdown_it_py-4.0.0.tar.gz\"
sha256 \"cb0a2b4aa34f932c007117b194e945bd74e0ec24133ceb5bac59009cda1cb9f3\"
end
resource \"mdurl\" do
url \"https://files.pythonhosted.org/packages/source/m/mdurl/mdurl-0.1.2.tar.gz\"
sha256 \"bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba\"
end
resource \"pygments\" do
url \"https://files.pythonhosted.org/packages/source/p/pygments/pygments-2.20.0.tar.gz\"
sha256 \"6757cd03768053ff99f3039c1a36d6c0aa0b263438fcab17520b30a303a82b5f\"
end
resource \"mdit-py-plugins\" do
url \"https://files.pythonhosted.org/packages/source/m/mdit-py-plugins/mdit_py_plugins-0.6.1.tar.gz\"
sha256 \"a2bca0f039f39dbd35fb74ae1b5f998608c437463371f0ff7f49a19a17a114d0\"
end
resource \"linkify-it-py\" do
url \"https://files.pythonhosted.org/packages/source/l/linkify-it-py/linkify_it_py-2.1.0.tar.gz\"
sha256 \"43360231720999c10e9328dc3691160e27a718e280673d444c38d7d3aaa3b98b\"
end
resource \"uc-micro-py\" do
url \"https://files.pythonhosted.org/packages/source/u/uc-micro-py/uc_micro_py-2.0.0.tar.gz\"
sha256 \"c53691e495c8db60e16ffc4861a35469b0ba0821fe409a8a7a0a71864d33a811\"
end
resource \"typing-extensions\" do
url \"https://files.pythonhosted.org/packages/source/t/typing_extensions/typing_extensions-4.15.0.tar.gz\"
sha256 \"0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466\"
end
def install
virtualenv_install_with_resources
end
test do
assert_match version.to_s, shell_output(\"#{bin}/dailybot --version\")
end
end
''').strip().replace('{version}', v).replace('{sha256}', s)
with open('homebrew-tap/Formula/dailybot.rb', 'w') as f:
f.write(formula + '\n')
"
- name: Commit and push
working-directory: homebrew-tap
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add Formula/dailybot.rb
git commit -m "Update dailybot to ${{ steps.version.outputs.version }}"
git push