Compare commits

...
Sign in to create a new pull request.

9 commits

Author SHA1 Message Date
23fd14db89 fix(ocb): actually use generated version
All checks were successful
Build OCB / check-version-exists (push) Successful in 18s
Build OCB / Build wheels (push) Successful in 6m17s
2025-10-11 13:44:09 +02:00
fd300caacc feat(ocb): upgrade to odoo 18 and drop cibuildwheel
All checks were successful
Build OCB / check-version-exists (push) Successful in 22s
Build OCB / Build wheels (push) Successful in 7m5s
2025-10-11 12:52:48 +02:00
2180e35cce feat: add OCB
Some checks failed
Build OCB / check-version-exists (push) Successful in 26s
Build OCB / Build wheels on ubuntu-latest (push) Failing after 14m53s
2025-07-22 19:10:12 +02:00
70847fa3e0 fix: only run on push if workflow has changed
Some checks failed
Build psycopg2 / check-version-exists (push) Successful in 6s
Build psycopg2 / Build wheels on ubuntu-latest (push) Has been cancelled
Build pycairo / Build wheels on ubuntu-latest (push) Has been cancelled
Build pycairo / check-version-exists (push) Has been cancelled
skip ci:
2025-06-12 18:58:12 +02:00
5a3f602505 feat: pin check action
All checks were successful
Build psycopg2 / check-version-exists (push) Successful in 6s
Build pycairo / check-version-exists (push) Successful in 6s
Build psycopg2 / Build wheels on ubuntu-latest (push) Successful in 3m11s
Build pycairo / Build wheels on ubuntu-latest (push) Has been skipped
2025-06-12 18:54:13 +02:00
67480bf24d feat: add psycopg2 2025-06-07 15:44:24 +02:00
7156948c0d fix: typo 2025-05-31 12:09:03 +02:00
81a5062ad2 fix: typo 2025-05-31 11:59:03 +02:00
ed6097b3fe feat: move action to own branch 2025-05-31 11:58:22 +02:00
6 changed files with 159 additions and 78 deletions

View file

@ -1,34 +0,0 @@
on:
workflow_call:
inputs:
github-repository:
required: true
type: string
pypi-package:
required: true
type: string
pypi-base-url:
required: true
type: string
outputs:
version: ${{ jobs.check-version-exists.outputs.version }}
jobs:
check-version-exists:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.check.outputs.version }}
steps:
- uses: actions/checkout@v4
- id: check
run: |
pip3 install requests
exec python3 .forgejo/workflows/check_version_exists.py >> $GITHUB_OUTPUT
env:
REPOSITORY: ${{ inputs.github-repository }}
PACKAGE: ${{ inputs.pypi-package}}
BASE_URL: ${{ inputs.pypi-base-url}}

View file

@ -1,37 +0,0 @@
#/usr/bin/env python3
import os
import re
import sys
import requests
def get_github_version(repository: str) -> str:
res = requests.get(f"https://api.github.com/repos/{repository}/releases/latest").json()
return res["tag_name"].removeprefix("v")
def does_pypi_version_exist(base_url: str, package: str, version: str) -> bool:
base_url = base_url.removesuffix("/")
version = version.replace(".", "\\.")
body = requests.get(f"{base_url}/simple/{package}").text
return len(re.findall(rf"<a href=\".+\">{package}-{version}-.+</a>", body, re.MULTILINE)) > 0
def main():
repository = os.environ["REPOSITORY"]
package = os.environ["PACKAGE"]
base_url = os.environ["FORGEJO_URL"]
version = get_github_version(repository)
if does_pypi_version_exist(base_url, package, version):
sys.exit(0)
print(f"version=v{version}")
if __name__ == "__main__":
main()

View file

@ -0,0 +1,66 @@
name: Build OCB
on:
workflow_dispatch:
schedule:
- cron: "0 10 * * 0"
push:
branches: ["main"]
paths: [".forgejo/workflows/ocb.yaml", "OCB/**/*"]
env:
REPOSITORY_URL: https://cmwedding-bot:${{ secrets.FORGEJO_TOKEN }}@git.weddingfactory.eu/api/packages/cmwedding/pypi
ODOO_VERSION: "18.0"
jobs:
check-version-exists:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.check.outputs.version }}
steps:
- id: check
uses: https://git.weddingfactory.eu/cmwedding/wheels@e8bb95db412835102b1ff58a955d29f00fd2f87f
with:
pypi-base-url: ${{ env.REPOSITORY_URL }}
pypi-package: odoo
github-repository: "OCA/OCB"
unstable-branch: ${{ env.ODOO_VERSION }}
build:
name: Build wheels
runs-on: self-hosted
needs: check-version-exists
if: needs.check-version-exists.outputs.version != ''
steps:
- run: git clone --depth=1 https://github.com/OCA/OCB --branch ${{ env.ODOO_VERSION }} .
- name: Patch source
run: |
rm pyproject.toml
wget "https://git.weddingfactory.eu/cmwedding/wheels/raw/branch/main/OCB/pyproject.toml"
sed -i 's/%s/${{ needs.check-version-exists.outputs.version }}/' pyproject.toml
- name: Setup dependencies
run: |
python3 -m venv .venv
source .venv/bin/activate
pip3 install build wheel setuptools twine
pip3 install --index-url https://git.weddingfactory.eu/api/packages/cmwedding/pypi/simple/ psycopg2 pycairo
- name: Build pure Python wheel
run: |
source .venv/bin/activate
python3 -m build --wheel
- name: Publish package distributions to Forgejo
run: |
source .venv/bin/activate
python3 -m twine upload ./dist/*
env:
TWINE_REPOSITORY_URL: ${{ env.REPOSITORY_URL }}
TWINE_NON_INTERACTIVE: 1

View file

@ -0,0 +1,58 @@
name: Build psycopg2
on:
workflow_dispatch:
schedule:
- cron: "0 10 * * 0"
push:
branches: ["main"]
paths: [".forgejo/workflows/psycopg2.yaml"]
env:
REPOSITORY_URL: https://cmwedding-bot:${{ secrets.FORGEJO_TOKEN }}@git.weddingfactory.eu/api/packages/cmwedding/pypi
jobs:
check-version-exists:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.check.outputs.version }}
steps:
- id: check
uses: https://git.weddingfactory.eu/cmwedding/wheels@f3ba8cbc3c3e080b14c8f244e531eaf36102959a
with:
pypi-base-url: ${{ env.REPOSITORY_URL }}
pypi-package: psycopg2
github-repository: "psycopg/psycopg2"
build:
name: Build wheels on ${{ matrix.os }}
needs: check-version-exists
if: needs.check-version-exists.outputs.version != ''
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- run: git clone --depth=1 https://github.com/psycopg/psycopg2 --branch ${{ needs.check-version-exists.outputs.version }} .
- name: Build wheels
uses: https://github.com/pypa/cibuildwheel@v2.23.3
env:
CIBW_BEFORE_ALL_LINUX: "dnf install -y postgresql-devel"
CIBW_BUILD: "cp31{0..3}-manylinux_{x86_64,aarch64}"
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28
- name: Publish package distributions to Forgejo
run: |
pip3 install twine
python3 -m twine upload ./wheelhouse/*
env:
TWINE_REPOSITORY_URL: ${{ env.REPOSITORY_URL }}
TWINE_NON_INTERACTIVE: 1

View file

@ -4,6 +4,9 @@ on:
workflow_dispatch:
schedule:
- cron: "0 10 * * 0"
push:
branches: ["main"]
paths: [".forgejo/workflows/pycairo.yaml"]
env:
REPOSITORY_URL: https://cmwedding-bot:${{ secrets.FORGEJO_TOKEN }}@git.weddingfactory.eu/api/packages/cmwedding/pypi
@ -11,17 +14,23 @@ env:
jobs:
check-version-exists:
runs-on: ubuntu-latest
uses: ./.forgejo/workflows/check-version-exists.yaml
with:
pypi-base-url: ${{ env.REPOSITORY_URL }}
pypi-package: pycairo
github-repository: "pygobject/pycairo"
outputs:
version: ${{ steps.check.outputs.version }}
steps:
- id: check
uses: https://git.weddingfactory.eu/cmwedding/wheels@f3ba8cbc3c3e080b14c8f244e531eaf36102959a
with:
pypi-base-url: ${{ env.REPOSITORY_URL }}
pypi-package: pycairo
github-repository: "pygobject/pycairo"
build:
name: Build wheels on ${{ matrix.os }}
needs: check-version-exists
if: needs.check-version-exists.outputs.version != ""
if: needs.check-version-exists.outputs.version != ''
runs-on: ${{ matrix.os }}
strategy:
@ -29,7 +38,7 @@ jobs:
os: [ubuntu-latest]
steps:
- run: git clone --depth=1 https://github.com/pygobject/pycairo --branch ${{ needs.check-version-exists.outputs.version }} .
- run: git clone --depth=1 https://github.com/pygobject/pycairo --branch v${{ needs.check-version-exists.outputs.version }} .
- name: Build wheels
uses: https://github.com/pypa/cibuildwheel@v2.23.3

19
OCB/pyproject.toml Normal file
View file

@ -0,0 +1,19 @@
[project]
name = "odoo"
version = "%s"
dynamic = [
"optional-dependencies",
"dependencies",
"classifiers",
"authors",
"license",
"requires-python",
"readme",
"description"
]
[build-system]
requires = ["setuptools>=41"]
build-backend = "pep517_odoo"
backend-path = ["setup"]