66 lines
1.9 KiB
YAML
66 lines
1.9 KiB
YAML
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/${{ env.ODOO_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
|