Skip to content

Commit

Permalink
JH: update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
adeepn committed Feb 14, 2024
1 parent e456747 commit d8aad20
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 18 deletions.
74 changes: 65 additions & 9 deletions .github/workflows/jh-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ on:

env:
BUILD_TYPE: core
DEFAULT_PYTHON: "3.11"
DEFAULT_PYTHON: "3.12"
PIP_TIMEOUT: 60

jobs:
init:
Expand Down Expand Up @@ -93,10 +94,55 @@ jobs:
twine upload dist/* --skip-existing
cache_translations:
name: Cache translations
if: github.repository_owner == 'jethub-homeassistant'
needs: init
runs-on: ${{ vars.RUNNER }}
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Checkout the repository
uses: actions/[email protected]

- name: update build.yaml
run: cp -f build-jethub.yaml build.yaml

- name: create dir for translations
run: |
mkdir -p build/translations-download
- name: Restore cache translation files
id: cache-translations
uses: actions/cache/restore@v4
with:
path: build/translations-download/
key: core-${{ github.sha }}-translations

- name: Check cache restore result
run: |
echo ${{ steps.cache-translations.outputs.cache-hit }}
- name: Download Translations
if: steps.cache-translations.outputs.cache-hit != 'true'
uses: transifex/cli-action@v2
with:
token: ${{ secrets.TX_TOKEN }}
args: pull -s -t -a

- name: Save translation files into cache
if: steps.cache-translations.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: build/translations-download/
key: core-${{ github.sha }}-translations

build_base:
name: Build ${{ matrix.arch }} base core image
if: github.repository_owner == 'jethub-homeassistant'
needs: init
needs: [ "init", "cache_translations" ]
runs-on: ${{ vars.RUNNER }}
permissions:
contents: read
Expand All @@ -114,7 +160,7 @@ jobs:

- name: Download nightly wheels of frontend
if: needs.init.outputs.channel == 'dev'
uses: dawidd6/action-download-artifact@v2
uses: dawidd6/action-download-artifact@v3.0.0
with:
github_token: ${{secrets.GITHUB_TOKEN}}
repo: home-assistant/frontend
Expand All @@ -125,7 +171,7 @@ jobs:

- name: Download nightly wheels of intents
if: needs.init.outputs.channel == 'dev'
uses: dawidd6/action-download-artifact@v2
uses: dawidd6/action-download-artifact@v3.0.0
with:
github_token: ${{secrets.GITHUB_TOKEN}}
repo: home-assistant/intents-package
Expand Down Expand Up @@ -198,13 +244,22 @@ jobs:
sed -i "s|pyezviz|# pyezviz|g" requirements_all.txt
sed -i "s|pykrakenapi|# pykrakenapi|g" requirements_all.txt
- name: Adjustments for 64-bit
if: matrix.arch == 'amd64' || matrix.arch == 'aarch64'
run: |
# Some speedups are only available on 64-bit, and since
# we build 32bit images on 64bit hosts, we only enable
# the speed ups on 64bit since the wheels for 32bit
# are not available.
sed -i "s|aiohttp-zlib-ng|aiohttp-zlib-ng\[isal\]|g" requirements_all.txt
- name: create dir for translations
run: |
mkdir -p build/translations-download
- name: Restore cache translation files
id: cache-translations
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
path: build/translations-download/
key: core-${{ github.sha }}-translations
Expand All @@ -214,15 +269,15 @@ jobs:
echo ${{ steps.cache-translations.outputs.cache-hit }}
- name: Download Translations
if: ${{ steps.cache-translations.outputs.cache-hit }} == 'false'
if: steps.cache-translations.outputs.cache-hit != 'true'
uses: transifex/cli-action@v2
with:
token: ${{ secrets.TX_TOKEN }}
args: pull -s -t -a

- name: Save translation files into cache
if: ${{ steps.cache-translations.outputs.cache-hit }} == 'false'
uses: actions/cache/save@v3
if: steps.cache-translations.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: build/translations-download/
key: core-${{ github.sha }}-translations
Expand Down Expand Up @@ -257,11 +312,12 @@ jobs:
run: find ./homeassistant/components/*/translations -name "*.json" | tar zcvf translations.tar.gz -T -

- name: Upload translations
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: translations
path: translations.tar.gz
if-no-files-found: error
overwrite: true

build_machine:
name: Build ${{ matrix.machine }} machine core image
Expand Down
24 changes: 15 additions & 9 deletions .github/workflows/jh-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@ jobs:
name: requirements_diff

- name: Build wheels
uses: jethub-homeassistant/wheels@2023.10.5
uses: jethub-homeassistant/wheels@2024.01.0
with:
abi: ${{ matrix.abi }}
tag: musllinux_1_2
arch: ${{ matrix.arch }}
wheels-key: ${{ secrets.WHEELS_KEY }}
env-file: true
apk: "libffi-dev;openssl-dev;yaml-dev"
apk: "libffi-dev;openssl-dev;yaml-dev;nasm"
skip-binary: aiohttp
constraints: "homeassistant/package_constraints.txt"
requirements-diff: "requirements_diff.txt"
Expand Down Expand Up @@ -162,6 +162,12 @@ jobs:
sed -i "s|pyezviz|# pyezviz|g" ${requirement_file}
sed -i "s|pykrakenapi|# pykrakenapi|g" ${requirement_file}
fi
# Some speedups are only for 64-bit
if [ "${{ matrix.arch }}" = "amd64" ] || [ "${{ matrix.arch }}" = "aarch64" ]; then
sed -i "s|aiohttp-zlib-ng|aiohttp-zlib-ng\[isal\]|g" ${requirement_file}
fi
done
- name: Split requirements all
Expand Down Expand Up @@ -194,7 +200,7 @@ jobs:
sed -i "/numpy/d" homeassistant/package_constraints.txt
- name: Build wheels (old cython)
uses: jethub-homeassistant/wheels@2023.10.5
uses: jethub-homeassistant/wheels@2024.01.0
with:
abi: ${{ matrix.abi }}
tag: musllinux_1_2
Expand All @@ -209,42 +215,42 @@ jobs:
pip: "'cython<3'"

- name: Build wheels (part 1)
uses: jethub-homeassistant/wheels@2023.10.5
uses: jethub-homeassistant/wheels@2024.01.0
with:
abi: ${{ matrix.abi }}
tag: musllinux_1_2
arch: ${{ matrix.arch }}
wheels-key: ${{ secrets.WHEELS_KEY }}
env-file: true
apk: "bluez-dev;libffi-dev;openssl-dev;glib-dev;eudev-dev;libxml2-dev;libxslt-dev;libpng-dev;libjpeg-turbo-dev;tiff-dev;cups-dev;gmp-dev;mpfr-dev;mpc1-dev;ffmpeg-dev;gammu-dev;yaml-dev;openblas-dev;fftw-dev;lapack-dev;gfortran;blas-dev;eigen-dev;freetype-dev;glew-dev;harfbuzz-dev;hdf5-dev;libdc1394-dev;libtbb-dev;mesa-dev;openexr-dev;openjpeg-dev;uchardet-dev"
apk: "bluez-dev;libffi-dev;openssl-dev;glib-dev;eudev-dev;libxml2-dev;libxslt-dev;libpng-dev;libjpeg-turbo-dev;tiff-dev;cups-dev;gmp-dev;mpfr-dev;mpc1-dev;ffmpeg-dev;gammu-dev;yaml-dev;openblas-dev;fftw-dev;lapack-dev;gfortran;blas-dev;eigen-dev;freetype-dev;glew-dev;harfbuzz-dev;hdf5-dev;libdc1394-dev;libtbb-dev;mesa-dev;openexr-dev;openjpeg-dev;uchardet-dev;nasm"
skip-binary: aiohttp;charset-normalizer;grpcio;SQLAlchemy;protobuf
constraints: "homeassistant/package_constraints.txt"
requirements-diff: "requirements_diff.txt"
requirements: "requirements_all.txtaa"

- name: Build wheels (part 2)
uses: jethub-homeassistant/wheels@2023.10.5
uses: jethub-homeassistant/wheels@2024.01.0
with:
abi: ${{ matrix.abi }}
tag: musllinux_1_2
arch: ${{ matrix.arch }}
wheels-key: ${{ secrets.WHEELS_KEY }}
env-file: true
apk: "bluez-dev;libffi-dev;openssl-dev;glib-dev;eudev-dev;libxml2-dev;libxslt-dev;libpng-dev;libjpeg-turbo-dev;tiff-dev;cups-dev;gmp-dev;mpfr-dev;mpc1-dev;ffmpeg-dev;gammu-dev;yaml-dev;openblas-dev;fftw-dev;lapack-dev;gfortran;blas-dev;eigen-dev;freetype-dev;glew-dev;harfbuzz-dev;hdf5-dev;libdc1394-dev;libtbb-dev;mesa-dev;openexr-dev;openjpeg-dev;uchardet-dev"
apk: "bluez-dev;libffi-dev;openssl-dev;glib-dev;eudev-dev;libxml2-dev;libxslt-dev;libpng-dev;libjpeg-turbo-dev;tiff-dev;cups-dev;gmp-dev;mpfr-dev;mpc1-dev;ffmpeg-dev;gammu-dev;yaml-dev;openblas-dev;fftw-dev;lapack-dev;gfortran;blas-dev;eigen-dev;freetype-dev;glew-dev;harfbuzz-dev;hdf5-dev;libdc1394-dev;libtbb-dev;mesa-dev;openexr-dev;openjpeg-dev;uchardet-dev;nasm"
skip-binary: aiohttp;charset-normalizer;grpcio;SQLAlchemy;protobuf
constraints: "homeassistant/package_constraints.txt"
requirements-diff: "requirements_diff.txt"
requirements: "requirements_all.txtab"

- name: Build wheels (part 3)
uses: jethub-homeassistant/wheels@2023.10.5
uses: jethub-homeassistant/wheels@2024.01.0
with:
abi: ${{ matrix.abi }}
tag: musllinux_1_2
arch: ${{ matrix.arch }}
wheels-key: ${{ secrets.WHEELS_KEY }}
env-file: true
apk: "bluez-dev;libffi-dev;openssl-dev;glib-dev;eudev-dev;libxml2-dev;libxslt-dev;libpng-dev;libjpeg-turbo-dev;tiff-dev;cups-dev;gmp-dev;mpfr-dev;mpc1-dev;ffmpeg-dev;gammu-dev;yaml-dev;openblas-dev;fftw-dev;lapack-dev;gfortran;blas-dev;eigen-dev;freetype-dev;glew-dev;harfbuzz-dev;hdf5-dev;libdc1394-dev;libtbb-dev;mesa-dev;openexr-dev;openjpeg-dev;uchardet-dev"
apk: "bluez-dev;libffi-dev;openssl-dev;glib-dev;eudev-dev;libxml2-dev;libxslt-dev;libpng-dev;libjpeg-turbo-dev;tiff-dev;cups-dev;gmp-dev;mpfr-dev;mpc1-dev;ffmpeg-dev;gammu-dev;yaml-dev;openblas-dev;fftw-dev;lapack-dev;gfortran;blas-dev;eigen-dev;freetype-dev;glew-dev;harfbuzz-dev;hdf5-dev;libdc1394-dev;libtbb-dev;mesa-dev;openexr-dev;openjpeg-dev;uchardet-dev;nasm"
skip-binary: aiohttp;charset-normalizer;grpcio;SQLAlchemy;protobuf
constraints: "homeassistant/package_constraints.txt"
requirements-diff: "requirements_diff.txt"
Expand Down

0 comments on commit d8aad20

Please sign in to comment.