Skip to content

Commit

Permalink
build(odoo): github action to publish odoo wheel
Browse files Browse the repository at this point in the history
  • Loading branch information
kafai-lam committed Jan 7, 2024
1 parent 3160d82 commit 64e9b62
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/odoo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Publish Odoo Packages

on:
workflow_dispatch:
schedule:
- cron: "0 8 * * 1"

env:
RELEASE_TAG: index

jobs:
build:
name: Build Odoo Packages
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
matrix:
odoo_version:
- "17.0"
- "16.0"
- "15.0"
steps:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Install Wheel
run: pip install wheel

- name: Set Date
id: set_date
run: |
today=$(date -u +%Y%m%d -d '-8 hours')
echo "date=$today" >> "$GITHUB_OUTPUT"
- name: Build Wheel
run: |
tar_file=odoo_${{ matrix.odoo_version }}.${{ steps.set_date.outputs.date }}.tar.gz
wget https://nightly.odoo.com/${{ matrix.odoo_version }}/nightly/tgz/$tar_file
mkdir odoo
tar -xvf $tar_file -C odoo --strip-components=1
cd odoo
python3 setup.py -q bdist_wheel
- name: Upload Artifacts
uses: AButler/[email protected]
with:
repo-token: ${{ github.token }}
release-tag: ${{ env.RELEASE_TAG }}
files: odoo/dist/*

publish:
name: Publish Packages
needs: build
permissions:
pages: write
id-token: write
uses: ./.github/workflows/pypi.yml

0 comments on commit 64e9b62

Please sign in to comment.