Publish Odoo Packages #26
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Odoo Packages | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 8 * * 1" | |
env: | |
AWS_S3_ENDPOINT_URL: https://86099e5f6de2cd6346db01f48072efa4.r2.cloudflarestorage.com | |
MC_ALIAS: r2 | |
BUCKET: wheelhouse | |
BUCKET_ACCESS_URL: https://wheelhouse.kafai.eu.org | |
jobs: | |
build: | |
name: Build Odoo Packages | |
runs-on: ubuntu-22.04 | |
permissions: | |
contents: write | |
strategy: | |
matrix: | |
odoo_version: | |
- "17.0" | |
- "16.0" | |
- "15.0" | |
steps: | |
- name: Setup Minio CLI | |
uses: hostwithquantum/setup-mc@main | |
with: | |
alias-name: ${{ env.MC_ALIAS }} | |
alias-url: ${{ env.AWS_S3_ENDPOINT_URL }} | |
alias-access-key: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
alias-secret-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
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 | |
run: | | |
cd odoo/dist | |
mc cp --recursive ./* ${{ env.MC_ALIAS }}/${{ env.BUCKET }} | |
publish: | |
name: Publish Packages | |
needs: build | |
permissions: | |
pages: write | |
id-token: write | |
secrets: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
uses: ./.github/workflows/pypi.yml |