From 6782b04b751d06d85d3c4838377ecb8426eb4f69 Mon Sep 17 00:00:00 2001 From: Jan Willhaus Date: Wed, 31 Jan 2024 22:46:16 +0100 Subject: [PATCH] build: Publish brew formula --- .github/workflows/publish.yaml | 12 ++++++++++++ brew/template.rb.j2 | 26 ++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 brew/template.rb.j2 diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 597f7b5..68b6b98 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -4,6 +4,8 @@ on: push: tags: - "v*.*.*" + branches: + - "publish-to-brew-tap" #FIXME: REMOVE pull_request: jobs: @@ -45,3 +47,13 @@ jobs: - name: Publish package distributions to PyPI uses: pypa/gh-action-pypi-publish@release/v1 + + homebrew: + uses: janw/workflows/.github/workflows/poetry-homebrew-formula.yaml@main + needs: build + with: + formula-name: podcast-archiver + secrets: + personal-access-token: ${{ secrets.BOT_PERSONAL_ACCESS_TOKEN }} + gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} + gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }} diff --git a/brew/template.rb.j2 b/brew/template.rb.j2 new file mode 100644 index 0000000..18f586d --- /dev/null +++ b/brew/template.rb.j2 @@ -0,0 +1,26 @@ +class {{ formula_name }} < Formula + include Language::Python::Virtualenv + + desc "{{ package.description }}" +{% if package.homepage %} homepage "{{ package.homepage }}" +{% endif %} +{% if package.license %} license "{{ package.license }}" +{% endif %} + head "https://github.com/janw/podcast-archiver.git", branch: "main" + +{{ PACKAGE_URL }} + + depends_on "python3" + depends_on "rust" => :build + +{{ RESOURCES }} + + def install + virtualenv_create(libexec, "python3") + virtualenv_install_with_resources + end + + test do + false + end +end