|
| 1 | +name: Release |
| 2 | +on: |
| 3 | + push: |
| 4 | + tags: |
| 5 | + - '**' |
| 6 | + branches-ignore: |
| 7 | + - '**' |
| 8 | +env: |
| 9 | + DOCKER_BUILDKIT: 1 |
| 10 | +jobs: |
| 11 | + build: |
| 12 | + runs-on: ubuntu-18.04 |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v2 |
| 15 | + - name: Install Dependencies |
| 16 | + run: | |
| 17 | + sudo apt-get update |
| 18 | + sudo apt-get install -y qemu-user qemu-user-static |
| 19 | + - name: Bazel Build Image |
| 20 | + run: | |
| 21 | + docker build \ |
| 22 | + --cache-from emacski/tensorflow-serving-arm-client:latest-devel \ |
| 23 | + --build-arg BUILDKIT_INLINE_CACHE=1 \ |
| 24 | + -t emacski/tensorflow-serving-arm-client:latest-devel \ |
| 25 | + -f tools/docker/Dockerfile . |
| 26 | + - name: Bazel Build Cache |
| 27 | + id: bazel-cache |
| 28 | + uses: actions/cache@v2 |
| 29 | + with: |
| 30 | + path: ~/.cache/bazel |
| 31 | + key: bazel-cache |
| 32 | + - name: Bazel Build |
| 33 | + run: | |
| 34 | + docker run --rm -v ${HOME}/.cache/bazel:/root/.cache/bazel --entrypoint chown emacski/tensorflow-serving-arm-client:latest-devel -R root:root /root/.cache/bazel |
| 35 | + tools/ci/bazel.sh run --spawn_strategy=local --config=release //python/wheel:build_pure |
| 36 | + tools/ci/bazel.sh run --spawn_strategy=local --config=release --config=linux_amd64 //python/wheel:build_platform |
| 37 | + tools/ci/bazel.sh run --spawn_strategy=local --config=release --config=linux_arm64 //python/wheel:build_platform |
| 38 | + tools/ci/bazel.sh run --spawn_strategy=local --config=release --config=linux_arm //python/wheel:build_platform |
| 39 | + sudo chown -R $(whoami):$(whoami) ${HOME}/.cache/bazel |
| 40 | + - name: Create Release |
| 41 | + id: create_release |
| 42 | + uses: actions/create-release@v1 |
| 43 | + env: |
| 44 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 45 | + with: |
| 46 | + tag_name: ${{ github.ref }} |
| 47 | + release_name: ${{ github.ref }} |
| 48 | + draft: false |
| 49 | + prerelease: false |
| 50 | + - name: Get Tag Name |
| 51 | + shell: bash |
| 52 | + run: echo "##[set-output name=name;]$(echo ${GITHUB_REF##*/})" |
| 53 | + id: get_tag |
| 54 | + - name: Upload Release Asset (pure) |
| 55 | + id: upload-release-asset-pure |
| 56 | + uses: actions/upload-release-asset@v1 |
| 57 | + env: |
| 58 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 59 | + with: |
| 60 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 61 | + asset_path: ./tensorflow_serving_arm_client-${{ steps.get_tag.outputs.name }}-py3-none-any.whl |
| 62 | + asset_name: tensorflow_serving_arm_client-${{ steps.get_tag.outputs.name }}-py3-none-any.whl |
| 63 | + asset_content_type: application/octet-stream |
| 64 | + - name: Upload Release Asset (cp37_linux_amd64) |
| 65 | + id: upload-release-cp37-linux-amd64 |
| 66 | + uses: actions/upload-release-asset@v1 |
| 67 | + env: |
| 68 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 69 | + with: |
| 70 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 71 | + asset_path: ./tensorflow_serving_arm_client-${{ steps.get_tag.outputs.name }}-cp37-none-manylinux2014_x86_64.whl |
| 72 | + asset_name: tensorflow_serving_arm_client-${{ steps.get_tag.outputs.name }}-cp37-none-manylinux2014_x86_64.whl |
| 73 | + asset_content_type: application/octet-stream |
| 74 | + - name: Upload Release Asset (cp37_linux_arm64) |
| 75 | + id: upload-release-assets-cp37-linux-arm64 |
| 76 | + uses: actions/upload-release-asset@v1 |
| 77 | + env: |
| 78 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 79 | + with: |
| 80 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 81 | + asset_path: ./tensorflow_serving_arm_client-${{ steps.get_tag.outputs.name }}-cp37-none-manylinux2014_aarch64.whl |
| 82 | + asset_name: tensorflow_serving_arm_client-${{ steps.get_tag.outputs.name }}-cp37-none-manylinux2014_aarch64.whl |
| 83 | + asset_content_type: application/octet-stream |
| 84 | + - name: Upload Release Asset (cp37_linux_arm) |
| 85 | + id: upload-release-assets-cp37-linux-arm |
| 86 | + uses: actions/upload-release-asset@v1 |
| 87 | + env: |
| 88 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 89 | + with: |
| 90 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 91 | + asset_path: ./tensorflow_serving_arm_client-${{ steps.get_tag.outputs.name }}-cp37-none-manylinux2014_armv7l.whl |
| 92 | + asset_name: tensorflow_serving_arm_client-${{ steps.get_tag.outputs.name }}-cp37-none-manylinux2014_armv7l.whl |
| 93 | + asset_content_type: application/octet-stream |
| 94 | + - name: Publish Build Image |
| 95 | + env: |
| 96 | + REGISTRY_USER: ${{ secrets.DockerHubUser }} |
| 97 | + REGISTRY_PASS: ${{ secrets.DockerHubToken }} |
| 98 | + run: | |
| 99 | + echo "$REGISTRY_PASS" | docker login -u "$REGISTRY_USER" --password-stdin || true |
| 100 | + docker push emacski/tensorflow-serving-arm-client:latest-devel |
0 commit comments