Skip to content

Commit

Permalink
Fix release workflow libray inclusion bug
Browse files Browse the repository at this point in the history
  • Loading branch information
panickal-xmos committed Aug 23, 2023
1 parent 31991da commit 4c3ec60
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 22 deletions.
123 changes: 102 additions & 21 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,77 @@ on:
env:
TAG_VERSION: ${{ github.event.inputs.version == 0 && github.ref_name || github.event.inputs.version }}
BAZEL_CACHE_URL: https://storage.googleapis.com/bazel_remote_cache_0/gh_actions
TOOLS_VERSION: 15.2.1
TOOLS_LINK: https://www.xmos.ai/download/Tools-15---Linux-64(15_2_1).tgz


jobs:
build-release-archive:
name: Build release archive
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
ref: ${{ env.TAG_VERSION }}
- name: Build setup
shell: bash
run: |
sudo apt-get -y -qq install libncurses5
cd $GITHUB_WORKSPACE/third_party/lib_tflite_micro
make patch
wget -nv "${{ env.TOOLS_LINK }}?key=${{ secrets.TOOLS_KEY }}" -O tools.tgz
tar xf tools.tgz
cd XMOS/XTC/${{ env.TOOLS_VERSION }}
source ./SetEnv
cd $GITHUB_WORKSPACE/third_party/lib_tflite_micro
mkdir -p build
cd build
cmake .. --toolchain=../lib_tflite_micro/submodules/xmos_cmake_toolchain/xs3a.cmake
make create_zip -j4
- uses: actions/upload-artifact@v3
with:
name: xcore-archive
path: third_party/lib_tflite_micro/build/*.zip



macos-release-wheel:
name: Build release wheels for macOS
needs: [build-release-archive]
runs-on: macos-latest
strategy:
matrix:
python-version: [3.8]
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
ref: ${{ env.TAG_VERSION }}
- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: google-github-actions/auth@v0
- uses: google-github-actions/auth@v1
continue-on-error: true
with:
credentials_json: ${{ secrets.BAZEL_REMOTE_CACHE_JSON_KEY }}
- uses: actions/download-artifact@v3
with:
name: xcore-archive
path: python/xmos_ai_tools/xinterpreters/device
- name: Prepare release archive
shell: bash
run: |
cd $GITHUB_WORKSPACE/python/xmos_ai_tools/xinterpreters/device
unzip release_archive.zip
rm release_archive.zip
- name: Build macOS wheels
env:
SETUPTOOLS_SCM_PRETEND_VERSION: ${{ env.TAG_VERSION }}
Expand All @@ -62,9 +110,9 @@ jobs:
bazelisk build //:xcore-opt --copt=-fvisibility=hidden --copt=-mavx --copt=-mmacosx-version-min=10.13 --linkopt=-mmacosx-version-min=10.13 --linkopt=-dead_strip --distinct_host_configuration=false --//:disable_version_check
cd $GITHUB_WORKSPACE/python
python setup.py bdist_wheel --plat macosx_10_9_x86_64
python setup.py bdist_wheel --plat macosx_10_14_x86_64
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: ${{ runner.os }}-wheels
path: python/dist
Expand All @@ -73,24 +121,35 @@ jobs:

macos-arm-release-wheel:
name: Build release wheels for macOS arm64
needs: [build-release-archive]
runs-on: macos-11
strategy:
matrix:
python-version: [3.8]
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
ref: ${{ env.TAG_VERSION }}
- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: google-github-actions/auth@v0
- uses: google-github-actions/auth@v1
continue-on-error: true
with:
credentials_json: ${{ secrets.BAZEL_REMOTE_CACHE_JSON_KEY }}
- uses: actions/download-artifact@v3
with:
name: xcore-archive
path: python/xmos_ai_tools/xinterpreters/device
- name: Prepare release archive
shell: bash
run: |
cd $GITHUB_WORKSPACE/python/xmos_ai_tools/xinterpreters/device
unzip release_archive.zip
rm release_archive.zip
- name: Build macOS arm wheels
env:
SETUPTOOLS_SCM_PRETEND_VERSION: ${{ env.TAG_VERSION }}
Expand All @@ -117,7 +176,7 @@ jobs:
cd $GITHUB_WORKSPACE/python
python setup.py bdist_wheel --plat-name macosx_11_0_arm64
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: ${{ runner.os }}-arm-wheels
path: python/dist
Expand All @@ -126,24 +185,35 @@ jobs:

manylinux-release-wheel:
name: Build release wheels for manylinux2014
needs: [build-release-archive]
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
ref: ${{ env.TAG_VERSION }}
- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: google-github-actions/auth@v0
- uses: google-github-actions/auth@v1
continue-on-error: true
with:
credentials_json: ${{ secrets.BAZEL_REMOTE_CACHE_JSON_KEY }}
- uses: actions/download-artifact@v3
with:
name: xcore-archive
path: python/xmos_ai_tools/xinterpreters/device
- name: Prepare release archive
shell: bash
run: |
cd $GITHUB_WORKSPACE/python/xmos_ai_tools/xinterpreters/device
unzip release_archive.zip
rm release_archive.zip
- name: Build manylinux2014 wheels
# The SETUPTOOLS_SCM_PRETEND_VERSION var is passed via docker to the
# python setup.py script to add the version info for the wheel file.
Expand Down Expand Up @@ -173,7 +243,7 @@ jobs:
auditwheel repair --plat manylinux2014_x86_64 $f
done
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: ${{ runner.os }}-wheels
# auditwheel creates the output wheel in the wheelhouse folder
Expand All @@ -183,21 +253,22 @@ jobs:

windows-release-wheel:
name: Build release wheels for windows
needs: [build-release-archive]
runs-on: windows-2019
strategy:
matrix:
python-version: [3.8]
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
ref: ${{ env.TAG_VERSION }}
- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: google-github-actions/auth@v0
- uses: google-github-actions/auth@v1
continue-on-error: true
with:
credentials_json: ${{ secrets.BAZEL_REMOTE_CACHE_JSON_KEY }}
Expand All @@ -210,6 +281,16 @@ jobs:
shell: pwsh
run: |
(Get-CimInstance Win32_PageFileUsage).AllocatedBaseSize
- uses: actions/download-artifact@v3
with:
name: xcore-archive
path: python/xmos_ai_tools/xinterpreters/device
- name: Prepare release archive
shell: cmd
run: |
cd %GITHUB_WORKSPACE%/python/xmos_ai_tools/xinterpreters/device
7z x release_archive.zip
del release_archive.zip
- name: Build xcore-opt and xtflm-interpreter
shell: cmd
run: |
Expand Down Expand Up @@ -237,7 +318,7 @@ jobs:
run: |
cd python
python setup.py bdist_wheel
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: ${{ runner.os }}-wheels
path: python/dist
Expand All @@ -250,22 +331,22 @@ jobs:
needs: [macos-release-wheel, macos-arm-release-wheel, manylinux-release-wheel, windows-release-wheel]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: macOS-wheels
path: macOS-wheels
if: ${{ needs.macos-release-wheel.result == 'success' }}
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: macOS-arm-wheels
path: macOS-arm-wheels
if: ${{ needs.macos-arm-release-wheel.result == 'success' }}
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: Linux-wheels
path: Linux-wheels
if: ${{ needs.manylinux-release-wheel.result == 'success' }}
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: Windows-wheels
path: Windows-wheels
Expand Down
2 changes: 1 addition & 1 deletion xformer/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace xformer {

unsigned majorVersion = 1;
unsigned minorVersion = 1;
unsigned patchVersion = 0;
unsigned patchVersion = 1;

} // namespace xformer

Expand Down

0 comments on commit 4c3ec60

Please sign in to comment.